Yarn 4 Migration (#32253)

Migrates the Overleaf monorepo package manager from npm (v11) to Yarn 4 (v4.9.1) using node-modules linker mode.

GitOrigin-RevId: 50d32ab01955c15e29679eff9e9e9cfb897fab2d
This commit is contained in:
Anna Claire Fields
2026-04-28 08:52:37 +00:00
committed by Copybot
parent ed0fb0110a
commit 0d64a88a46
137 changed files with 39227 additions and 538 deletions
+5 -3
View File
@@ -5,6 +5,8 @@
FROM node:24.14.1 AS base
WORKDIR /overleaf/services/chat
ENV PATH="/overleaf/node_modules/.bin:$PATH"
RUN corepack enable
# Google Cloud Storage needs a writable $HOME/.config for resumable uploads
# (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream)
@@ -12,7 +14,7 @@ RUN mkdir /home/node/.config && chown node:node /home/node/.config
FROM base AS app
COPY package.json package-lock.json /overleaf/
COPY package.json yarn.lock .yarnrc.yml /overleaf/
COPY libraries/fetch-utils/package.json /overleaf/libraries/fetch-utils/package.json
COPY libraries/logger/package.json /overleaf/libraries/logger/package.json
COPY libraries/metrics/package.json /overleaf/libraries/metrics/package.json
@@ -22,10 +24,10 @@ COPY libraries/promise-utils/package.json /overleaf/libraries/promise-utils/pack
COPY libraries/settings/package.json /overleaf/libraries/settings/package.json
COPY services/chat/package.json /overleaf/services/chat/package.json
COPY tools/migrations/package.json /overleaf/tools/migrations/package.json
COPY patches/ /overleaf/patches/
COPY .yarn/patches/ /overleaf/.yarn/patches/
COPY tools/migrations/ /overleaf/tools/migrations/
RUN cd /overleaf && npm ci --quiet
RUN cd /overleaf && yarn workspaces focus @overleaf/chat overleaf
COPY libraries/fetch-utils/ /overleaf/libraries/fetch-utils/
COPY libraries/logger/ /overleaf/libraries/logger/
COPY libraries/metrics/ /overleaf/libraries/metrics/
+12 -12
View File
@@ -15,7 +15,7 @@ IMAGE_REPO ?= us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME)
IMAGE_REPO_FINAL ?= $(IMAGE_REPO):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER)
IMAGE_CACHE ?= $(IMAGE_REPO):cache-$(shell cat \
$(MONOREPO)/package.json \
$(MONOREPO)/package-lock.json \
$(MONOREPO)/yarn.lock \
$(MONOREPO)/libraries/fetch-utils/package.json \
$(MONOREPO)/libraries/logger/package.json \
$(MONOREPO)/libraries/metrics/package.json \
@@ -25,7 +25,7 @@ IMAGE_CACHE ?= $(IMAGE_REPO):cache-$(shell cat \
$(MONOREPO)/libraries/settings/package.json \
$(MONOREPO)/services/chat/package.json \
$(MONOREPO)/tools/migrations/package.json \
$(MONOREPO)/patches/* \
$(MONOREPO)/.yarn/patches/* \
| sha256sum | cut -d '-' -f1)
DOCKER_COMPOSE_FLAGS ?= -f docker-compose.yml
@@ -52,11 +52,11 @@ 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) --user node node:24.14.1 npm run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) --user node node:24.14.1 npm run --silent
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) -e PATH=$(MONOREPO)/node_modules/.bin:$$PATH --user node node:24.14.1 corepack yarn run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) -e PATH=$(MONOREPO)/node_modules/.bin:$$PATH --user node node:24.14.1 corepack yarn 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache $(IMAGE_CI) 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache -w /overleaf $(IMAGE_CI) 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache $(IMAGE_CI) corepack yarn 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache -w /overleaf $(IMAGE_CI) corepack yarn run --silent
SHELLCHECK_OPTS = \
--shell=bash \
@@ -95,19 +95,19 @@ $(WITH_CACHE_FOLDER): ../../node_modules/.cache/eslint/
mkdir -p $@
format:
$(RUN_LINTING_MONOREPO) format -- services/chat
$(RUN_LINTING_MONOREPO) format services/chat
format_ci:
$(RUN_LINTING_CI_MONOREPO) format -- services/chat
$(RUN_LINTING_CI_MONOREPO) format services/chat
format_fix:
$(RUN_LINTING_MONOREPO) format:fix -- services/chat
$(RUN_LINTING_MONOREPO) format:fix services/chat
lint:
$(RUN_LINTING) lint
lint_ci:
-$(RUN_LINTING_CI) lint -- --format json --output-file reports/eslint.json
-$(RUN_LINTING_CI) lint --format json --output-file reports/eslint.json
sed -i 's_"filePath":"/overleaf_"filePath":"$(MONOREPO)_g' reports/eslint.json
lint_fix:
@@ -145,7 +145,7 @@ endif
test_acceptance_run_debug:
ifneq (,$(wildcard test/acceptance))
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run -p 127.0.0.9:19999:19999 --rm test_acceptance npm run test:acceptance -- --inspect=0.0.0.0:19999 --inspect-brk
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run -p 127.0.0.9:19999:19999 --rm test_acceptance corepack yarn run --inspect=0.0.0.0:19999 --inspect-brk test:acceptance
endif
test_clean: test_acceptance_clean
@@ -158,7 +158,7 @@ ifneq (,$(wildcard test/acceptance/js/scripts/pre-run))
endif
benchmarks:
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run --rm test_acceptance npm run benchmarks
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run --rm test_acceptance corepack yarn run benchmarks
build:
docker build \
+1
View File
@@ -4,5 +4,6 @@ chat
--env-pass-through=
--esmock-loader=False
--node-version=24.14.1
--package-name=@overleaf/chat
--pipeline-owner=44
--public-repo=False
+2 -2
View File
@@ -10,7 +10,7 @@ services:
- ./reports:/overleaf/services/chat/reports
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:unit:_run
command: yarn run test:unit:_run
environment:
CI:
MONGO_CONNECTION_STRING: mongodb://mongo/test-overleaf
@@ -39,7 +39,7 @@ services:
condition: service_started
user: node
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:acceptance
command: yarn run test:acceptance
tar:
build: .
+8 -2
View File
@@ -9,6 +9,9 @@ services:
- .:/overleaf/services/chat
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
working_dir: /overleaf/services/chat
@@ -19,7 +22,7 @@ services:
NODE_ENV: test
NODE_OPTIONS: "--unhandled-rejections=strict"
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run --silent test:unit
command: corepack yarn run --silent test:unit
user: node
depends_on:
mongo:
@@ -31,6 +34,9 @@ services:
- .:/overleaf/services/chat
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
working_dir: /overleaf/services/chat
@@ -47,7 +53,7 @@ services:
mongo:
condition: service_started
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run --silent test:acceptance
command: corepack yarn run --silent test:acceptance
mongo:
image: mongo:8.0.11
+3 -3
View File
@@ -6,8 +6,8 @@
"type": "module",
"scripts": {
"start": "node app.js",
"test:acceptance": "npm run test:acceptance:_run -- --grep=$MOCHA_GREP",
"test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP",
"test:acceptance": "yarn run test:acceptance:_run -- --grep=$MOCHA_GREP",
"test:unit": "yarn run test:unit:_run -- --grep=$MOCHA_GREP",
"nodemon": "node --watch app.js",
"test:acceptance:_run": "mocha --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js",
"test:unit:_run": "mocha --recursive --exit $@ test/unit/js",
@@ -28,7 +28,7 @@
"mongodb": "6.12.0"
},
"devDependencies": {
"@overleaf/migrations": "*",
"@overleaf/migrations": "workspace:*",
"acorn": "^7.1.1",
"ajv": "^6.12.0",
"chai": "^4.3.6",
+5 -3
View File
@@ -5,6 +5,8 @@
FROM node:24.14.1 AS base
WORKDIR /overleaf/services/clsi
ENV PATH="/overleaf/node_modules/.bin:$PATH"
RUN corepack enable
COPY services/clsi/install_deps.sh /overleaf/services/clsi/
RUN chmod 0755 ./install_deps.sh && ./install_deps.sh
ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]
@@ -16,7 +18,7 @@ RUN mkdir /home/node/.config && chown node:node /home/node/.config
FROM base AS app
COPY package.json package-lock.json /overleaf/
COPY package.json yarn.lock .yarnrc.yml /overleaf/
COPY libraries/fetch-utils/package.json /overleaf/libraries/fetch-utils/package.json
COPY libraries/logger/package.json /overleaf/libraries/logger/package.json
COPY libraries/metrics/package.json /overleaf/libraries/metrics/package.json
@@ -26,9 +28,9 @@ COPY libraries/promise-utils/package.json /overleaf/libraries/promise-utils/pack
COPY libraries/settings/package.json /overleaf/libraries/settings/package.json
COPY libraries/stream-utils/package.json /overleaf/libraries/stream-utils/package.json
COPY services/clsi/package.json /overleaf/services/clsi/package.json
COPY patches/ /overleaf/patches/
COPY .yarn/patches/ /overleaf/.yarn/patches/
RUN cd /overleaf && npm ci --quiet
RUN cd /overleaf && yarn workspaces focus @overleaf/clsi overleaf
COPY libraries/fetch-utils/ /overleaf/libraries/fetch-utils/
COPY libraries/logger/ /overleaf/libraries/logger/
COPY libraries/metrics/ /overleaf/libraries/metrics/
+12 -12
View File
@@ -15,7 +15,7 @@ IMAGE_REPO ?= us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME)
IMAGE_REPO_FINAL ?= $(IMAGE_REPO):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER)
IMAGE_CACHE ?= $(IMAGE_REPO):cache-$(shell cat \
$(MONOREPO)/package.json \
$(MONOREPO)/package-lock.json \
$(MONOREPO)/yarn.lock \
$(MONOREPO)/libraries/fetch-utils/package.json \
$(MONOREPO)/libraries/logger/package.json \
$(MONOREPO)/libraries/metrics/package.json \
@@ -25,7 +25,7 @@ IMAGE_CACHE ?= $(IMAGE_REPO):cache-$(shell cat \
$(MONOREPO)/libraries/settings/package.json \
$(MONOREPO)/libraries/stream-utils/package.json \
$(MONOREPO)/services/clsi/package.json \
$(MONOREPO)/patches/* \
$(MONOREPO)/.yarn/patches/* \
| sha256sum | cut -d '-' -f1)
DOCKER_COMPOSE_FLAGS ?= -f docker-compose.yml
@@ -53,11 +53,11 @@ 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) --user node node:24.14.1 npm run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) --user node node:24.14.1 npm run --silent
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) -e PATH=$(MONOREPO)/node_modules/.bin:$$PATH --user node node:24.14.1 corepack yarn run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) -e PATH=$(MONOREPO)/node_modules/.bin:$$PATH --user node node:24.14.1 corepack yarn 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache $(IMAGE_CI) 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache -w /overleaf $(IMAGE_CI) 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache $(IMAGE_CI) corepack yarn 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache -w /overleaf $(IMAGE_CI) corepack yarn run --silent
SHELLCHECK_OPTS = \
--shell=bash \
@@ -96,19 +96,19 @@ $(WITH_CACHE_FOLDER): ../../node_modules/.cache/eslint/
mkdir -p $@
format:
$(RUN_LINTING_MONOREPO) format -- services/clsi
$(RUN_LINTING_MONOREPO) format services/clsi
format_ci:
$(RUN_LINTING_CI_MONOREPO) format -- services/clsi
$(RUN_LINTING_CI_MONOREPO) format services/clsi
format_fix:
$(RUN_LINTING_MONOREPO) format:fix -- services/clsi
$(RUN_LINTING_MONOREPO) format:fix services/clsi
lint:
$(RUN_LINTING) lint
lint_ci:
-$(RUN_LINTING_CI) lint -- --format json --output-file reports/eslint.json
-$(RUN_LINTING_CI) lint --format json --output-file reports/eslint.json
sed -i 's_"filePath":"/overleaf_"filePath":"$(MONOREPO)_g' reports/eslint.json
lint_fix:
@@ -146,7 +146,7 @@ endif
test_acceptance_run_debug:
ifneq (,$(wildcard test/acceptance))
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run -p 127.0.0.9:19999:19999 --rm test_acceptance npm run test:acceptance -- --inspect=0.0.0.0:19999 --inspect-brk
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run -p 127.0.0.9:19999:19999 --rm test_acceptance corepack yarn run --inspect=0.0.0.0:19999 --inspect-brk test:acceptance
endif
test_clean: test_acceptance_clean
@@ -161,7 +161,7 @@ ifneq (,$(wildcard test/acceptance/js/scripts/pre-run))
endif
benchmarks:
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run --rm test_acceptance npm run benchmarks
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run --rm test_acceptance corepack yarn run benchmarks
build:
docker build \
+2 -1
View File
@@ -1,10 +1,11 @@
clsi
--data-dirs=cache,compiles,output
--dependencies=
--env-add=DOWNLOAD_HOST=http://clsi-nginx:8080,ALLOWED_COMPILE_GROUPS="clsi-perf simple-latex-file",ENABLE_PDF_CACHING="true",PDF_CACHING_ENABLE_WORKER_POOL="true",ALLOWED_IMAGES="quay.io/sharelatex/texlive-full:2017.1 quay.io/sharelatex/texlive-full:2025.1 quay.io/sharelatex/pandoc:3.9",TEXLIVE_IMAGE=quay.io/sharelatex/texlive-full:2025.1,TEX_LIVE_IMAGE_NAME_OVERRIDE=us-east1-docker.pkg.dev/overleaf-ops/ol-docker,TEXLIVE_IMAGE_USER="tex",SANDBOXED_COMPILES="true",SANDBOXED_COMPILES_HOST_DIR_COMPILES=$PWD/compiles,SANDBOXED_COMPILES_HOST_DIR_OUTPUT=$PWD/output,ENABLE_PANDOC_CONVERSIONS=true
--env-add=DOWNLOAD_HOST=http://clsi-nginx:8080,ALLOWED_COMPILE_GROUPS=clsi-perf simple-latex-file,ENABLE_PDF_CACHING=true,PDF_CACHING_ENABLE_WORKER_POOL=true,ALLOWED_IMAGES=quay.io/sharelatex/texlive-full:2017.1 quay.io/sharelatex/texlive-full:2025.1 quay.io/sharelatex/pandoc:3.9,TEXLIVE_IMAGE=quay.io/sharelatex/texlive-full:2025.1,TEX_LIVE_IMAGE_NAME_OVERRIDE=us-east1-docker.pkg.dev/overleaf-ops/ol-docker,TEXLIVE_IMAGE_USER=tex,SANDBOXED_COMPILES=true,SANDBOXED_COMPILES_HOST_DIR_COMPILES=$PWD/compiles,SANDBOXED_COMPILES_HOST_DIR_OUTPUT=$PWD/output,ENABLE_PANDOC_CONVERSIONS=true
--env-pass-through=
--esmock-loader=False
--node-version=24.14.1
--package-name=@overleaf/clsi
--pipeline-owner=32
--public-repo=True
--test-unit-vitest=True
+8 -8
View File
@@ -8,7 +8,7 @@ services:
volumes:
- ./reports:/overleaf/services/clsi/reports
- ../../tsconfig.backend.json:/overleaf/tsconfig.backend.json
command: npm run test:unit:_run
command: yarn run test:unit:_run
environment:
CI:
MONGO_CONNECTION_STRING: mongodb://mongo/test-overleaf
@@ -28,14 +28,14 @@ services:
NODE_ENV: test
NODE_OPTIONS: "--unhandled-rejections=strict"
DOWNLOAD_HOST: http://clsi-nginx:8080
ALLOWED_COMPILE_GROUPS: "clsi-perf simple-latex-file"
ENABLE_PDF_CACHING: "true"
PDF_CACHING_ENABLE_WORKER_POOL: "true"
ALLOWED_IMAGES: "quay.io/sharelatex/texlive-full:2017.1 quay.io/sharelatex/texlive-full:2025.1 quay.io/sharelatex/pandoc:3.9"
ALLOWED_COMPILE_GROUPS: clsi-perf simple-latex-file
ENABLE_PDF_CACHING: true
PDF_CACHING_ENABLE_WORKER_POOL: true
ALLOWED_IMAGES: quay.io/sharelatex/texlive-full:2017.1 quay.io/sharelatex/texlive-full:2025.1 quay.io/sharelatex/pandoc:3.9
TEXLIVE_IMAGE: quay.io/sharelatex/texlive-full:2025.1
TEX_LIVE_IMAGE_NAME_OVERRIDE: us-east1-docker.pkg.dev/overleaf-ops/ol-docker
TEXLIVE_IMAGE_USER: "tex"
SANDBOXED_COMPILES: "true"
TEXLIVE_IMAGE_USER: tex
SANDBOXED_COMPILES: true
SANDBOXED_COMPILES_HOST_DIR_COMPILES: $PWD/compiles
SANDBOXED_COMPILES_HOST_DIR_OUTPUT: $PWD/output
ENABLE_PANDOC_CONVERSIONS: true
@@ -47,7 +47,7 @@ services:
depends_on:
clsi-nginx:
condition: service_started
command: npm run test:acceptance
command: yarn run test:acceptance
tar:
build: .
+14 -8
View File
@@ -12,6 +12,9 @@ services:
- .:/overleaf/services/clsi
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../tsconfig.backend.json:/overleaf/tsconfig.backend.json
working_dir: /overleaf/services/clsi
environment:
@@ -20,7 +23,7 @@ services:
MONGO_CONNECTION_STRING: mongodb://mongo/test-overleaf
NODE_ENV: test
NODE_OPTIONS: "--unhandled-rejections=strict"
command: npm run --silent test:unit
command: corepack yarn run --silent test:unit
test_acceptance:
build:
@@ -31,6 +34,9 @@ services:
- .:/overleaf/services/clsi
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- /var/run/docker.sock:/var/run/docker.sock
working_dir: /overleaf/services/clsi
environment:
@@ -42,21 +48,21 @@ services:
NODE_ENV: test
NODE_OPTIONS: "--unhandled-rejections=strict"
DOWNLOAD_HOST: http://clsi-nginx:8080
ALLOWED_COMPILE_GROUPS: "clsi-perf simple-latex-file"
ENABLE_PDF_CACHING: "true"
PDF_CACHING_ENABLE_WORKER_POOL: "true"
ALLOWED_IMAGES: "quay.io/sharelatex/texlive-full:2017.1 quay.io/sharelatex/texlive-full:2025.1 quay.io/sharelatex/pandoc:3.9"
ALLOWED_COMPILE_GROUPS: clsi-perf simple-latex-file
ENABLE_PDF_CACHING: true
PDF_CACHING_ENABLE_WORKER_POOL: true
ALLOWED_IMAGES: quay.io/sharelatex/texlive-full:2017.1 quay.io/sharelatex/texlive-full:2025.1 quay.io/sharelatex/pandoc:3.9
TEXLIVE_IMAGE: quay.io/sharelatex/texlive-full:2025.1
TEX_LIVE_IMAGE_NAME_OVERRIDE: us-east1-docker.pkg.dev/overleaf-ops/ol-docker
TEXLIVE_IMAGE_USER: "tex"
SANDBOXED_COMPILES: "true"
TEXLIVE_IMAGE_USER: tex
SANDBOXED_COMPILES: true
SANDBOXED_COMPILES_HOST_DIR_COMPILES: $PWD/compiles
SANDBOXED_COMPILES_HOST_DIR_OUTPUT: $PWD/output
ENABLE_PANDOC_CONVERSIONS: true
depends_on:
clsi-nginx:
condition: service_started
command: npm run --silent test:acceptance
command: corepack yarn run --silent test:acceptance
clsi-nginx:
image: nginx:1.28
+10 -10
View File
@@ -7,22 +7,22 @@
"scripts": {
"start": "node app.js",
"test:acceptance:_run": "mocha --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js",
"test:acceptance": "npm run test:acceptance:_run -- --grep=$MOCHA_GREP",
"test:acceptance": "yarn run test:acceptance:_run -- --grep=$MOCHA_GREP",
"test:unit:_run": "vitest --config ./vitest.config.unit.cjs",
"test:unit": "npm run test:unit:_run",
"test:unit": "yarn run test:unit:_run",
"nodemon": "node --watch app.js",
"lint": "eslint --cache --cache-location ../../node_modules/.cache/eslint/ --max-warnings 0 --format unix .",
"lint:fix": "eslint --cache --cache-location ../../node_modules/.cache/eslint/ --fix .",
"types:check": "tsc --noEmit"
},
"dependencies": {
"@overleaf/fetch-utils": "*",
"@overleaf/logger": "*",
"@overleaf/metrics": "*",
"@overleaf/o-error": "*",
"@overleaf/promise-utils": "*",
"@overleaf/settings": "*",
"@overleaf/stream-utils": "*",
"@overleaf/fetch-utils": "workspace:*",
"@overleaf/logger": "workspace:*",
"@overleaf/metrics": "workspace:*",
"@overleaf/o-error": "workspace:*",
"@overleaf/promise-utils": "workspace:*",
"@overleaf/settings": "workspace:*",
"@overleaf/stream-utils": "workspace:*",
"archiver": "5.3.2",
"async": "^3.2.5",
"body-parser": "1.20.4",
@@ -31,7 +31,7 @@
"express": "4.22.1",
"lodash": "^4.17.21",
"multer": "2.1.1",
"overleaf-editor-core": "*",
"overleaf-editor-core": "workspace:*",
"p-limit": "^3.1.0",
"request": "2.88.2",
"send": "^0.19.0",
+26
View File
@@ -4,7 +4,33 @@ import chaiAsPromised from 'chai-as-promised'
// Setup chai
chai.should()
// Workaround: vitest's built-in chai plugins register spy-related properties
// (e.g. callCount) as getter-only via addChainableMethod. sinon-chai then tries
// to overwrite them via addMethod (plain property assignment), which fails.
// Pre-delete the conflicting getter-only properties so the assignment succeeds.
const sinonChaiMethodProps = [
'callCount',
'calledBefore',
'calledAfter',
'calledImmediatelyBefore',
'calledImmediatelyAfter',
'calledOn',
'calledWith',
'calledOnceWith',
'calledWithExactly',
'calledOnceWithExactly',
'calledWithMatch',
'returned',
'thrown',
]
for (const name of sinonChaiMethodProps) {
if (Object.getOwnPropertyDescriptor(chai.Assertion.prototype, name)?.get) {
delete chai.Assertion.prototype[name]
}
}
chai.use(sinonChai)
chai.use(chaiAsPromised)
beforeEach(() => {
+5 -3
View File
@@ -5,6 +5,8 @@
FROM node:24.14.1 AS base
WORKDIR /overleaf/services/contacts
ENV PATH="/overleaf/node_modules/.bin:$PATH"
RUN corepack enable
# Google Cloud Storage needs a writable $HOME/.config for resumable uploads
# (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream)
@@ -12,7 +14,7 @@ RUN mkdir /home/node/.config && chown node:node /home/node/.config
FROM base AS app
COPY package.json package-lock.json /overleaf/
COPY package.json yarn.lock .yarnrc.yml /overleaf/
COPY libraries/fetch-utils/package.json /overleaf/libraries/fetch-utils/package.json
COPY libraries/logger/package.json /overleaf/libraries/logger/package.json
COPY libraries/metrics/package.json /overleaf/libraries/metrics/package.json
@@ -22,10 +24,10 @@ COPY libraries/promise-utils/package.json /overleaf/libraries/promise-utils/pack
COPY libraries/settings/package.json /overleaf/libraries/settings/package.json
COPY services/contacts/package.json /overleaf/services/contacts/package.json
COPY tools/migrations/package.json /overleaf/tools/migrations/package.json
COPY patches/ /overleaf/patches/
COPY .yarn/patches/ /overleaf/.yarn/patches/
COPY tools/migrations/ /overleaf/tools/migrations/
RUN cd /overleaf && npm ci --quiet
RUN cd /overleaf && yarn workspaces focus @overleaf/contacts overleaf
COPY libraries/fetch-utils/ /overleaf/libraries/fetch-utils/
COPY libraries/logger/ /overleaf/libraries/logger/
COPY libraries/metrics/ /overleaf/libraries/metrics/
+12 -12
View File
@@ -15,7 +15,7 @@ IMAGE_REPO ?= us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME)
IMAGE_REPO_FINAL ?= $(IMAGE_REPO):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER)
IMAGE_CACHE ?= $(IMAGE_REPO):cache-$(shell cat \
$(MONOREPO)/package.json \
$(MONOREPO)/package-lock.json \
$(MONOREPO)/yarn.lock \
$(MONOREPO)/libraries/fetch-utils/package.json \
$(MONOREPO)/libraries/logger/package.json \
$(MONOREPO)/libraries/metrics/package.json \
@@ -25,7 +25,7 @@ IMAGE_CACHE ?= $(IMAGE_REPO):cache-$(shell cat \
$(MONOREPO)/libraries/settings/package.json \
$(MONOREPO)/services/contacts/package.json \
$(MONOREPO)/tools/migrations/package.json \
$(MONOREPO)/patches/* \
$(MONOREPO)/.yarn/patches/* \
| sha256sum | cut -d '-' -f1)
DOCKER_COMPOSE_FLAGS ?= -f docker-compose.yml
@@ -52,11 +52,11 @@ 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) --user node node:24.14.1 npm run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) --user node node:24.14.1 npm run --silent
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) -e PATH=$(MONOREPO)/node_modules/.bin:$$PATH --user node node:24.14.1 corepack yarn run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) -e PATH=$(MONOREPO)/node_modules/.bin:$$PATH --user node node:24.14.1 corepack yarn 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache $(IMAGE_CI) 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache -w /overleaf $(IMAGE_CI) 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache $(IMAGE_CI) corepack yarn 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache -w /overleaf $(IMAGE_CI) corepack yarn run --silent
SHELLCHECK_OPTS = \
--shell=bash \
@@ -95,19 +95,19 @@ $(WITH_CACHE_FOLDER): ../../node_modules/.cache/eslint/
mkdir -p $@
format:
$(RUN_LINTING_MONOREPO) format -- services/contacts
$(RUN_LINTING_MONOREPO) format services/contacts
format_ci:
$(RUN_LINTING_CI_MONOREPO) format -- services/contacts
$(RUN_LINTING_CI_MONOREPO) format services/contacts
format_fix:
$(RUN_LINTING_MONOREPO) format:fix -- services/contacts
$(RUN_LINTING_MONOREPO) format:fix services/contacts
lint:
$(RUN_LINTING) lint
lint_ci:
-$(RUN_LINTING_CI) lint -- --format json --output-file reports/eslint.json
-$(RUN_LINTING_CI) lint --format json --output-file reports/eslint.json
sed -i 's_"filePath":"/overleaf_"filePath":"$(MONOREPO)_g' reports/eslint.json
lint_fix:
@@ -145,7 +145,7 @@ endif
test_acceptance_run_debug:
ifneq (,$(wildcard test/acceptance))
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run -p 127.0.0.9:19999:19999 --rm test_acceptance npm run test:acceptance -- --inspect=0.0.0.0:19999 --inspect-brk
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run -p 127.0.0.9:19999:19999 --rm test_acceptance corepack yarn run --inspect=0.0.0.0:19999 --inspect-brk test:acceptance
endif
test_clean: test_acceptance_clean
@@ -158,7 +158,7 @@ ifneq (,$(wildcard test/acceptance/js/scripts/pre-run))
endif
benchmarks:
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run --rm test_acceptance npm run benchmarks
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run --rm test_acceptance corepack yarn run benchmarks
build:
docker build \
+1
View File
@@ -4,5 +4,6 @@ contacts
--env-pass-through=
--esmock-loader=True
--node-version=24.14.1
--package-name=@overleaf/contacts
--pipeline-owner=52
--public-repo=False
+2 -2
View File
@@ -10,7 +10,7 @@ services:
- ./reports:/overleaf/services/contacts/reports
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:unit:_run
command: yarn run test:unit:_run
environment:
CI:
MONGO_CONNECTION_STRING: mongodb://mongo/test-overleaf
@@ -39,7 +39,7 @@ services:
condition: service_started
user: node
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:acceptance
command: yarn run test:acceptance
tar:
build: .
+8 -2
View File
@@ -9,6 +9,9 @@ services:
- .:/overleaf/services/contacts
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
working_dir: /overleaf/services/contacts
@@ -19,7 +22,7 @@ services:
NODE_ENV: test
NODE_OPTIONS: "--unhandled-rejections=strict"
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run --silent test:unit
command: corepack yarn run --silent test:unit
user: node
depends_on:
mongo:
@@ -31,6 +34,9 @@ services:
- .:/overleaf/services/contacts
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
working_dir: /overleaf/services/contacts
@@ -47,7 +53,7 @@ services:
mongo:
condition: service_started
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run --silent test:acceptance
command: corepack yarn run --silent test:acceptance
mongo:
image: mongo:8.0.11
+7 -7
View File
@@ -7,19 +7,19 @@
"scripts": {
"start": "node app.js",
"test:acceptance:_run": "mocha --loader=esmock --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js",
"test:acceptance": "npm run test:acceptance:_run -- --grep=$MOCHA_GREP",
"test:acceptance": "yarn run test:acceptance:_run -- --grep=$MOCHA_GREP",
"test:unit:_run": "mocha --loader=esmock --recursive --exit $@ test/unit/js",
"test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP",
"test:unit": "yarn run test:unit:_run -- --grep=$MOCHA_GREP",
"nodemon": "node --watch app.js",
"lint": "eslint --cache --cache-location ../../node_modules/.cache/eslint/ --max-warnings 0 --format unix .",
"lint:fix": "eslint --cache --cache-location ../../node_modules/.cache/eslint/ --fix .",
"types:check": "tsc --noEmit"
},
"dependencies": {
"@overleaf/logger": "*",
"@overleaf/metrics": "*",
"@overleaf/mongo-utils": "*",
"@overleaf/settings": "*",
"@overleaf/logger": "workspace:*",
"@overleaf/metrics": "workspace:*",
"@overleaf/mongo-utils": "workspace:*",
"@overleaf/settings": "workspace:*",
"async": "^3.2.5",
"body-parser": "1.20.4",
"bunyan": "^1.8.15",
@@ -29,7 +29,7 @@
"underscore": "~1.13.1"
},
"devDependencies": {
"@overleaf/migrations": "*",
"@overleaf/migrations": "workspace:*",
"chai": "^4.3.6",
"chai-as-promised": "^7.1.1",
"esmock": "^2.6.3",
+5 -3
View File
@@ -5,6 +5,8 @@
FROM node:24.14.1 AS base
WORKDIR /overleaf/services/docstore
ENV PATH="/overleaf/node_modules/.bin:$PATH"
RUN corepack enable
# Google Cloud Storage needs a writable $HOME/.config for resumable uploads
# (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream)
@@ -12,7 +14,7 @@ RUN mkdir /home/node/.config && chown node:node /home/node/.config
FROM base AS app
COPY package.json package-lock.json /overleaf/
COPY package.json yarn.lock .yarnrc.yml /overleaf/
COPY libraries/fetch-utils/package.json /overleaf/libraries/fetch-utils/package.json
COPY libraries/logger/package.json /overleaf/libraries/logger/package.json
COPY libraries/metrics/package.json /overleaf/libraries/metrics/package.json
@@ -24,10 +26,10 @@ COPY libraries/settings/package.json /overleaf/libraries/settings/package.json
COPY libraries/stream-utils/package.json /overleaf/libraries/stream-utils/package.json
COPY services/docstore/package.json /overleaf/services/docstore/package.json
COPY tools/migrations/package.json /overleaf/tools/migrations/package.json
COPY patches/ /overleaf/patches/
COPY .yarn/patches/ /overleaf/.yarn/patches/
COPY tools/migrations/ /overleaf/tools/migrations/
RUN cd /overleaf && npm ci --quiet
RUN cd /overleaf && yarn workspaces focus @overleaf/docstore overleaf
COPY libraries/fetch-utils/ /overleaf/libraries/fetch-utils/
COPY libraries/logger/ /overleaf/libraries/logger/
COPY libraries/metrics/ /overleaf/libraries/metrics/
+12 -12
View File
@@ -15,7 +15,7 @@ IMAGE_REPO ?= us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME)
IMAGE_REPO_FINAL ?= $(IMAGE_REPO):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER)
IMAGE_CACHE ?= $(IMAGE_REPO):cache-$(shell cat \
$(MONOREPO)/package.json \
$(MONOREPO)/package-lock.json \
$(MONOREPO)/yarn.lock \
$(MONOREPO)/libraries/fetch-utils/package.json \
$(MONOREPO)/libraries/logger/package.json \
$(MONOREPO)/libraries/metrics/package.json \
@@ -27,7 +27,7 @@ IMAGE_CACHE ?= $(IMAGE_REPO):cache-$(shell cat \
$(MONOREPO)/libraries/stream-utils/package.json \
$(MONOREPO)/services/docstore/package.json \
$(MONOREPO)/tools/migrations/package.json \
$(MONOREPO)/patches/* \
$(MONOREPO)/.yarn/patches/* \
| sha256sum | cut -d '-' -f1)
DOCKER_COMPOSE_FLAGS ?= -f docker-compose.yml
@@ -54,11 +54,11 @@ 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) --user node node:24.14.1 npm run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) --user node node:24.14.1 npm run --silent
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) -e PATH=$(MONOREPO)/node_modules/.bin:$$PATH --user node node:24.14.1 corepack yarn run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) -e PATH=$(MONOREPO)/node_modules/.bin:$$PATH --user node node:24.14.1 corepack yarn 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache $(IMAGE_CI) 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache -w /overleaf $(IMAGE_CI) 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache $(IMAGE_CI) corepack yarn 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache -w /overleaf $(IMAGE_CI) corepack yarn run --silent
SHELLCHECK_OPTS = \
--shell=bash \
@@ -97,19 +97,19 @@ $(WITH_CACHE_FOLDER): ../../node_modules/.cache/eslint/
mkdir -p $@
format:
$(RUN_LINTING_MONOREPO) format -- services/docstore
$(RUN_LINTING_MONOREPO) format services/docstore
format_ci:
$(RUN_LINTING_CI_MONOREPO) format -- services/docstore
$(RUN_LINTING_CI_MONOREPO) format services/docstore
format_fix:
$(RUN_LINTING_MONOREPO) format:fix -- services/docstore
$(RUN_LINTING_MONOREPO) format:fix services/docstore
lint:
$(RUN_LINTING) lint
lint_ci:
-$(RUN_LINTING_CI) lint -- --format json --output-file reports/eslint.json
-$(RUN_LINTING_CI) lint --format json --output-file reports/eslint.json
sed -i 's_"filePath":"/overleaf_"filePath":"$(MONOREPO)_g' reports/eslint.json
lint_fix:
@@ -147,7 +147,7 @@ endif
test_acceptance_run_debug:
ifneq (,$(wildcard test/acceptance))
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run -p 127.0.0.9:19999:19999 --rm test_acceptance npm run test:acceptance -- --inspect=0.0.0.0:19999 --inspect-brk
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run -p 127.0.0.9:19999:19999 --rm test_acceptance corepack yarn run --inspect=0.0.0.0:19999 --inspect-brk test:acceptance
endif
test_clean: test_acceptance_clean
@@ -160,7 +160,7 @@ ifneq (,$(wildcard test/acceptance/js/scripts/pre-run))
endif
benchmarks:
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run --rm test_acceptance npm run benchmarks
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run --rm test_acceptance corepack yarn run benchmarks
build:
docker build \
+1
View File
@@ -4,6 +4,7 @@ docstore
--env-pass-through=
--esmock-loader=False
--node-version=24.14.1
--package-name=@overleaf/docstore
--pipeline-owner=32
--public-repo=True
--test-unit-vitest=True
+2 -2
View File
@@ -11,7 +11,7 @@ services:
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tsconfig.backend.json:/overleaf/tsconfig.backend.json
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:unit:_run
command: yarn run test:unit:_run
environment:
CI:
MONGO_CONNECTION_STRING: mongodb://mongo/test-overleaf
@@ -46,7 +46,7 @@ services:
condition: service_healthy
user: node
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:acceptance
command: yarn run test:acceptance
tar:
build: .
+8 -2
View File
@@ -9,6 +9,9 @@ services:
- .:/overleaf/services/docstore
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
- ../../tsconfig.backend.json:/overleaf/tsconfig.backend.json
@@ -20,7 +23,7 @@ services:
NODE_ENV: test
NODE_OPTIONS: "--unhandled-rejections=strict"
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run --silent test:unit
command: corepack yarn run --silent test:unit
user: node
depends_on:
mongo:
@@ -32,6 +35,9 @@ services:
- .:/overleaf/services/docstore
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
working_dir: /overleaf/services/docstore
@@ -53,7 +59,7 @@ services:
gcs:
condition: service_healthy
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run --silent test:acceptance
command: corepack yarn run --silent test:acceptance
mongo:
image: mongo:8.0.11
+11 -11
View File
@@ -7,23 +7,23 @@
"scripts": {
"start": "node app.js",
"test:acceptance:_run": "mocha --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js",
"test:acceptance": "npm run test:acceptance:_run -- --grep=$MOCHA_GREP",
"test:acceptance": "yarn run test:acceptance:_run -- --grep=$MOCHA_GREP",
"test:unit:_run": "vitest --config ./vitest.config.unit.cjs",
"test:unit": "npm run test:unit:_run",
"test:unit": "yarn run test:unit:_run",
"nodemon": "node --watch app.js",
"lint": "eslint --cache --cache-location ../../node_modules/.cache/eslint/ --max-warnings 0 --format unix .",
"lint:fix": "eslint --cache --cache-location ../../node_modules/.cache/eslint/ --fix .",
"types:check": "tsc --noEmit"
},
"dependencies": {
"@overleaf/fetch-utils": "*",
"@overleaf/logger": "*",
"@overleaf/metrics": "*",
"@overleaf/mongo-utils": "*",
"@overleaf/o-error": "*",
"@overleaf/object-persistor": "*",
"@overleaf/promise-utils": "*",
"@overleaf/settings": "*",
"@overleaf/fetch-utils": "workspace:*",
"@overleaf/logger": "workspace:*",
"@overleaf/metrics": "workspace:*",
"@overleaf/mongo-utils": "workspace:*",
"@overleaf/o-error": "workspace:*",
"@overleaf/object-persistor": "workspace:*",
"@overleaf/promise-utils": "workspace:*",
"@overleaf/settings": "workspace:*",
"@overleaf/stream-utils": "^0.1.0",
"async": "^3.2.5",
"body-parser": "1.20.4",
@@ -36,7 +36,7 @@
},
"devDependencies": {
"@google-cloud/storage": "^7.19.0",
"@overleaf/migrations": "*",
"@overleaf/migrations": "workspace:*",
"chai": "^4.3.6",
"chai-as-promised": "^7.1.1",
"mocha": "^11.1.0",
+5 -3
View File
@@ -5,6 +5,8 @@
FROM node:24.14.1 AS base
WORKDIR /overleaf/services/document-updater
ENV PATH="/overleaf/node_modules/.bin:$PATH"
RUN corepack enable
# Google Cloud Storage needs a writable $HOME/.config for resumable uploads
# (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream)
@@ -12,7 +14,7 @@ RUN mkdir /home/node/.config && chown node:node /home/node/.config
FROM base AS app
COPY package.json package-lock.json /overleaf/
COPY package.json yarn.lock .yarnrc.yml /overleaf/
COPY libraries/fetch-utils/package.json /overleaf/libraries/fetch-utils/package.json
COPY libraries/logger/package.json /overleaf/libraries/logger/package.json
COPY libraries/metrics/package.json /overleaf/libraries/metrics/package.json
@@ -25,10 +27,10 @@ COPY libraries/redis-wrapper/package.json /overleaf/libraries/redis-wrapper/pack
COPY libraries/settings/package.json /overleaf/libraries/settings/package.json
COPY services/document-updater/package.json /overleaf/services/document-updater/package.json
COPY tools/migrations/package.json /overleaf/tools/migrations/package.json
COPY patches/ /overleaf/patches/
COPY .yarn/patches/ /overleaf/.yarn/patches/
COPY tools/migrations/ /overleaf/tools/migrations/
RUN cd /overleaf && npm ci --quiet
RUN cd /overleaf && yarn workspaces focus @overleaf/document-updater overleaf
COPY libraries/fetch-utils/ /overleaf/libraries/fetch-utils/
COPY libraries/logger/ /overleaf/libraries/logger/
COPY libraries/metrics/ /overleaf/libraries/metrics/
+12 -12
View File
@@ -15,7 +15,7 @@ IMAGE_REPO ?= us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME)
IMAGE_REPO_FINAL ?= $(IMAGE_REPO):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER)
IMAGE_CACHE ?= $(IMAGE_REPO):cache-$(shell cat \
$(MONOREPO)/package.json \
$(MONOREPO)/package-lock.json \
$(MONOREPO)/yarn.lock \
$(MONOREPO)/libraries/fetch-utils/package.json \
$(MONOREPO)/libraries/logger/package.json \
$(MONOREPO)/libraries/metrics/package.json \
@@ -28,7 +28,7 @@ IMAGE_CACHE ?= $(IMAGE_REPO):cache-$(shell cat \
$(MONOREPO)/libraries/settings/package.json \
$(MONOREPO)/services/document-updater/package.json \
$(MONOREPO)/tools/migrations/package.json \
$(MONOREPO)/patches/* \
$(MONOREPO)/.yarn/patches/* \
| sha256sum | cut -d '-' -f1)
DOCKER_COMPOSE_FLAGS ?= -f docker-compose.yml
@@ -55,11 +55,11 @@ 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) --user node node:24.14.1 npm run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) --user node node:24.14.1 npm run --silent
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) -e PATH=$(MONOREPO)/node_modules/.bin:$$PATH --user node node:24.14.1 corepack yarn run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) -e PATH=$(MONOREPO)/node_modules/.bin:$$PATH --user node node:24.14.1 corepack yarn 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache $(IMAGE_CI) 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache -w /overleaf $(IMAGE_CI) 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache $(IMAGE_CI) corepack yarn 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache -w /overleaf $(IMAGE_CI) corepack yarn run --silent
SHELLCHECK_OPTS = \
--shell=bash \
@@ -98,19 +98,19 @@ $(WITH_CACHE_FOLDER): ../../node_modules/.cache/eslint/
mkdir -p $@
format:
$(RUN_LINTING_MONOREPO) format -- services/document-updater
$(RUN_LINTING_MONOREPO) format services/document-updater
format_ci:
$(RUN_LINTING_CI_MONOREPO) format -- services/document-updater
$(RUN_LINTING_CI_MONOREPO) format services/document-updater
format_fix:
$(RUN_LINTING_MONOREPO) format:fix -- services/document-updater
$(RUN_LINTING_MONOREPO) format:fix services/document-updater
lint:
$(RUN_LINTING) lint
lint_ci:
-$(RUN_LINTING_CI) lint -- --format json --output-file reports/eslint.json
-$(RUN_LINTING_CI) lint --format json --output-file reports/eslint.json
sed -i 's_"filePath":"/overleaf_"filePath":"$(MONOREPO)_g' reports/eslint.json
lint_fix:
@@ -148,7 +148,7 @@ endif
test_acceptance_run_debug:
ifneq (,$(wildcard test/acceptance))
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run -p 127.0.0.9:19999:19999 --rm test_acceptance npm run test:acceptance -- --inspect=0.0.0.0:19999 --inspect-brk
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run -p 127.0.0.9:19999:19999 --rm test_acceptance corepack yarn run --inspect=0.0.0.0:19999 --inspect-brk test:acceptance
endif
test_clean: test_acceptance_clean
@@ -161,7 +161,7 @@ ifneq (,$(wildcard test/acceptance/js/scripts/pre-run))
endif
benchmarks:
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run --rm test_acceptance npm run benchmarks
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run --rm test_acceptance corepack yarn run benchmarks
build:
docker build \
@@ -4,5 +4,6 @@ document-updater
--env-pass-through=
--esmock-loader=False
--node-version=24.14.1
--package-name=@overleaf/document-updater
--pipeline-owner=44
--public-repo=True
@@ -10,7 +10,7 @@ services:
- ./reports:/overleaf/services/document-updater/reports
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:unit:_run
command: yarn run test:unit:_run
environment:
CI:
MONGO_CONNECTION_STRING: mongodb://mongo/test-overleaf
@@ -53,7 +53,7 @@ services:
condition: service_healthy
user: node
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:acceptance
command: yarn run test:acceptance
tar:
build: .
+8 -2
View File
@@ -9,6 +9,9 @@ services:
- .:/overleaf/services/document-updater
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
working_dir: /overleaf/services/document-updater
@@ -24,7 +27,7 @@ services:
ANALYTICS_QUEUES_REDIS_HOST: redis_test
ANALYTICS_QUEUES_BQ_SINK_REDIS_HOST: redis_test
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run --silent test:unit
command: corepack yarn run --silent test:unit
user: node
depends_on:
mongo:
@@ -38,6 +41,9 @@ services:
- .:/overleaf/services/document-updater
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
working_dir: /overleaf/services/document-updater
@@ -61,7 +67,7 @@ services:
redis_test:
condition: service_healthy
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run --silent test:acceptance
command: corepack yarn run --silent test:acceptance
redis_test:
image: redis:7.4.8
+13 -13
View File
@@ -6,9 +6,9 @@
"scripts": {
"start": "node app.js",
"test:acceptance:_run": "mocha --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js",
"test:acceptance": "npm run test:acceptance:_run -- --grep=$MOCHA_GREP",
"test:acceptance": "yarn run test:acceptance:_run -- --grep=$MOCHA_GREP",
"test:unit:_run": "mocha --recursive --exit $@ test/unit/js",
"test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP",
"test:unit": "yarn run test:unit:_run -- --grep=$MOCHA_GREP",
"nodemon": "node --watch app.js",
"benchmark:apply": "node benchmarks/apply",
"lint": "eslint --cache --cache-location ../../node_modules/.cache/eslint/ --max-warnings 0 --format unix .",
@@ -16,15 +16,15 @@
"types:check": "tsc --noEmit"
},
"dependencies": {
"@overleaf/fetch-utils": "*",
"@overleaf/logger": "*",
"@overleaf/metrics": "*",
"@overleaf/mongo-utils": "*",
"@overleaf/o-error": "*",
"@overleaf/promise-utils": "*",
"@overleaf/ranges-tracker": "*",
"@overleaf/redis-wrapper": "*",
"@overleaf/settings": "*",
"@overleaf/fetch-utils": "workspace:*",
"@overleaf/logger": "workspace:*",
"@overleaf/metrics": "workspace:*",
"@overleaf/mongo-utils": "workspace:*",
"@overleaf/o-error": "workspace:*",
"@overleaf/promise-utils": "workspace:*",
"@overleaf/ranges-tracker": "workspace:*",
"@overleaf/redis-wrapper": "workspace:*",
"@overleaf/settings": "workspace:*",
"@types/chai-as-promised": "^7.1.8",
"async": "^3.2.5",
"body-parser": "1.20.4",
@@ -35,10 +35,10 @@
"lodash": "^4.17.21",
"minimist": "^1.2.8",
"mongodb-legacy": "6.1.3",
"overleaf-editor-core": "*"
"overleaf-editor-core": "workspace:*"
},
"devDependencies": {
"@overleaf/migrations": "*",
"@overleaf/migrations": "workspace:*",
"basic-auth": "^2.0.1",
"chai": "^4.3.6",
"chai-as-promised": "^7.1.1",
+5 -3
View File
@@ -5,6 +5,8 @@
FROM node:24.14.1 AS base
WORKDIR /overleaf/services/filestore
ENV PATH="/overleaf/node_modules/.bin:$PATH"
RUN corepack enable
COPY services/filestore/install_deps.sh /overleaf/services/filestore/
RUN chmod 0755 ./install_deps.sh && ./install_deps.sh
@@ -14,7 +16,7 @@ RUN mkdir /home/node/.config && chown node:node /home/node/.config
FROM base AS app
COPY package.json package-lock.json /overleaf/
COPY package.json yarn.lock .yarnrc.yml /overleaf/
COPY libraries/fetch-utils/package.json /overleaf/libraries/fetch-utils/package.json
COPY libraries/logger/package.json /overleaf/libraries/logger/package.json
COPY libraries/metrics/package.json /overleaf/libraries/metrics/package.json
@@ -23,9 +25,9 @@ COPY libraries/object-persistor/package.json /overleaf/libraries/object-persisto
COPY libraries/settings/package.json /overleaf/libraries/settings/package.json
COPY libraries/stream-utils/package.json /overleaf/libraries/stream-utils/package.json
COPY services/filestore/package.json /overleaf/services/filestore/package.json
COPY patches/ /overleaf/patches/
COPY .yarn/patches/ /overleaf/.yarn/patches/
RUN cd /overleaf && npm ci --quiet
RUN cd /overleaf && yarn workspaces focus @overleaf/filestore overleaf
COPY libraries/fetch-utils/ /overleaf/libraries/fetch-utils/
COPY libraries/logger/ /overleaf/libraries/logger/
COPY libraries/metrics/ /overleaf/libraries/metrics/
+12 -12
View File
@@ -15,7 +15,7 @@ IMAGE_REPO ?= us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME)
IMAGE_REPO_FINAL ?= $(IMAGE_REPO):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER)
IMAGE_CACHE ?= $(IMAGE_REPO):cache-$(shell cat \
$(MONOREPO)/package.json \
$(MONOREPO)/package-lock.json \
$(MONOREPO)/yarn.lock \
$(MONOREPO)/libraries/fetch-utils/package.json \
$(MONOREPO)/libraries/logger/package.json \
$(MONOREPO)/libraries/metrics/package.json \
@@ -24,7 +24,7 @@ IMAGE_CACHE ?= $(IMAGE_REPO):cache-$(shell cat \
$(MONOREPO)/libraries/settings/package.json \
$(MONOREPO)/libraries/stream-utils/package.json \
$(MONOREPO)/services/filestore/package.json \
$(MONOREPO)/patches/* \
$(MONOREPO)/.yarn/patches/* \
| sha256sum | cut -d '-' -f1)
DOCKER_COMPOSE_FLAGS ?= -f docker-compose.yml
@@ -52,11 +52,11 @@ 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) --user node node:24.14.1 npm run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) --user node node:24.14.1 npm run --silent
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) -e PATH=$(MONOREPO)/node_modules/.bin:$$PATH --user node node:24.14.1 corepack yarn run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) -e PATH=$(MONOREPO)/node_modules/.bin:$$PATH --user node node:24.14.1 corepack yarn 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache $(IMAGE_CI) 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache -w /overleaf $(IMAGE_CI) 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache $(IMAGE_CI) corepack yarn 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache -w /overleaf $(IMAGE_CI) corepack yarn run --silent
SHELLCHECK_OPTS = \
--shell=bash \
@@ -95,19 +95,19 @@ $(WITH_CACHE_FOLDER): ../../node_modules/.cache/eslint/
mkdir -p $@
format:
$(RUN_LINTING_MONOREPO) format -- services/filestore
$(RUN_LINTING_MONOREPO) format services/filestore
format_ci:
$(RUN_LINTING_CI_MONOREPO) format -- services/filestore
$(RUN_LINTING_CI_MONOREPO) format services/filestore
format_fix:
$(RUN_LINTING_MONOREPO) format:fix -- services/filestore
$(RUN_LINTING_MONOREPO) format:fix services/filestore
lint:
$(RUN_LINTING) lint
lint_ci:
-$(RUN_LINTING_CI) lint -- --format json --output-file reports/eslint.json
-$(RUN_LINTING_CI) lint --format json --output-file reports/eslint.json
sed -i 's_"filePath":"/overleaf_"filePath":"$(MONOREPO)_g' reports/eslint.json
lint_fix:
@@ -145,7 +145,7 @@ endif
test_acceptance_run_debug:
ifneq (,$(wildcard test/acceptance))
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run -p 127.0.0.9:19999:19999 --rm test_acceptance npm run test:acceptance -- --inspect=0.0.0.0:19999 --inspect-brk
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run -p 127.0.0.9:19999:19999 --rm test_acceptance corepack yarn run --inspect=0.0.0.0:19999 --inspect-brk test:acceptance
endif
test_clean: test_acceptance_clean
@@ -158,7 +158,7 @@ ifneq (,$(wildcard test/acceptance/js/scripts/pre-run))
endif
benchmarks:
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run --rm test_acceptance npm run benchmarks
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run --rm test_acceptance corepack yarn run benchmarks
build:
docker build \
+2 -1
View File
@@ -1,10 +1,11 @@
filestore
--data-dirs=uploads,template_files
--dependencies=s3,gcs
--env-add=ENABLE_CONVERSIONS="true",USE_PROM_METRICS="true",AWS_S3_USER_FILES_STORAGE_CLASS=REDUCED_REDUNDANCY,AWS_S3_USER_FILES_BUCKET_NAME=fake-user-files,AWS_S3_USER_FILES_DEK_BUCKET_NAME=fake-user-files-dek,AWS_S3_TEMPLATE_FILES_BUCKET_NAME=fake-template-files,GCS_USER_FILES_BUCKET_NAME=fake-gcs-user-files,GCS_TEMPLATE_FILES_BUCKET_NAME=fake-gcs-template-files
--env-add=ENABLE_CONVERSIONS=true,USE_PROM_METRICS=true,AWS_S3_USER_FILES_STORAGE_CLASS=REDUCED_REDUNDANCY,AWS_S3_USER_FILES_BUCKET_NAME=fake-user-files,AWS_S3_USER_FILES_DEK_BUCKET_NAME=fake-user-files-dek,AWS_S3_TEMPLATE_FILES_BUCKET_NAME=fake-template-files,GCS_USER_FILES_BUCKET_NAME=fake-gcs-user-files,GCS_TEMPLATE_FILES_BUCKET_NAME=fake-gcs-template-files
--env-pass-through=
--esmock-loader=False
--node-version=24.14.1
--package-name=@overleaf/filestore
--pipeline-owner=32
--public-repo=True
--test-acceptance-shards=SHARD_01_,SHARD_02_,SHARD_03_
+4 -4
View File
@@ -12,7 +12,7 @@ services:
volumes:
- ./reports:/overleaf/services/filestore/reports
- ../../tsconfig.backend.json:/overleaf/tsconfig.backend.json
command: npm run test:unit:_run
command: yarn run test:unit:_run
environment:
CI:
MONGO_CONNECTION_STRING: mongodb://mongo/test-overleaf
@@ -41,8 +41,8 @@ services:
MOCHA_GREP: ${MOCHA_GREP}
NODE_ENV: test
NODE_OPTIONS: "--unhandled-rejections=strict"
ENABLE_CONVERSIONS: "true"
USE_PROM_METRICS: "true"
ENABLE_CONVERSIONS: true
USE_PROM_METRICS: true
AWS_S3_USER_FILES_STORAGE_CLASS: REDUCED_REDUNDANCY
AWS_S3_USER_FILES_BUCKET_NAME: fake-user-files
AWS_S3_USER_FILES_DEK_BUCKET_NAME: fake-user-files-dek
@@ -62,7 +62,7 @@ services:
gcs:
condition: service_healthy
user: node
command: npm run test:acceptance
command: yarn run test:acceptance
tar:
build: .
+10 -4
View File
@@ -15,6 +15,9 @@ services:
- .:/overleaf/services/filestore
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../tsconfig.backend.json:/overleaf/tsconfig.backend.json
working_dir: /overleaf/services/filestore
environment:
@@ -23,7 +26,7 @@ services:
MONGO_CONNECTION_STRING: mongodb://mongo/test-overleaf
NODE_ENV: test
NODE_OPTIONS: "--unhandled-rejections=strict"
command: npm run --silent test:unit
command: corepack yarn run --silent test:unit
user: node
test_acceptance:
@@ -35,6 +38,9 @@ services:
- .:/overleaf/services/filestore
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- minio-certs:/certs
working_dir: /overleaf/services/filestore
environment:
@@ -55,8 +61,8 @@ services:
LOG_LEVEL: ${LOG_LEVEL:-}
NODE_ENV: test
NODE_OPTIONS: "--unhandled-rejections=strict"
ENABLE_CONVERSIONS: "true"
USE_PROM_METRICS: "true"
ENABLE_CONVERSIONS: true
USE_PROM_METRICS: true
AWS_S3_USER_FILES_STORAGE_CLASS: REDUCED_REDUNDANCY
AWS_S3_USER_FILES_BUCKET_NAME: fake-user-files
AWS_S3_USER_FILES_DEK_BUCKET_NAME: fake-user-files-dek
@@ -73,7 +79,7 @@ services:
condition: service_completed_successfully
gcs:
condition: service_healthy
command: npm run --silent test:acceptance
command: corepack yarn run --silent test:acceptance
certs:
build:
+7 -7
View File
@@ -6,9 +6,9 @@
"type": "module",
"scripts": {
"test:acceptance:run": "mocha --recursive --timeout 15000 $@ test/acceptance/js",
"test:acceptance": "npm run test:acceptance:_run -- --grep=$MOCHA_GREP",
"test:acceptance": "yarn run test:acceptance:_run -- --grep=$MOCHA_GREP",
"test:unit:run": "mocha --recursive $@ test/unit/js",
"test:unit": "npm run test:unit:_run",
"test:unit": "yarn run test:unit:_run",
"start": "node app.js",
"nodemon": "node --watch app.js",
"lint": "eslint --cache --cache-location ../../node_modules/.cache/eslint/ --max-warnings 0 --format unix .",
@@ -19,11 +19,11 @@
},
"dependencies": {
"@aws-sdk/client-s3": "^3.994.0",
"@overleaf/logger": "*",
"@overleaf/metrics": "*",
"@overleaf/o-error": "*",
"@overleaf/object-persistor": "*",
"@overleaf/settings": "*",
"@overleaf/logger": "workspace:*",
"@overleaf/metrics": "workspace:*",
"@overleaf/o-error": "workspace:*",
"@overleaf/object-persistor": "workspace:*",
"@overleaf/settings": "workspace:*",
"@overleaf/stream-utils": "^0.1.0",
"body-parser": "1.20.4",
"bunyan": "^1.8.15",
+25
View File
@@ -4,7 +4,32 @@ import mongodb from 'mongodb'
import sinonChai from 'sinon-chai'
import chaiAsPromised from 'chai-as-promised'
// Workaround: vitest's built-in chai plugins register spy-related properties
// (e.g. callCount) as getter-only via addChainableMethod. sinon-chai then tries
// to overwrite them via addMethod (plain property assignment), which fails.
// Pre-delete the conflicting getter-only properties so the assignment succeeds.
const sinonChaiMethodProps = [
'callCount',
'calledBefore',
'calledAfter',
'calledImmediatelyBefore',
'calledImmediatelyAfter',
'calledOn',
'calledWith',
'calledOnceWith',
'calledWithExactly',
'calledOnceWithExactly',
'calledWithMatch',
'returned',
'thrown',
]
for (const name of sinonChaiMethodProps) {
if (Object.getOwnPropertyDescriptor(chai.Assertion.prototype, name)?.get) {
delete chai.Assertion.prototype[name]
}
}
chai.use(sinonChai)
chai.use(chaiAsPromised)
// ensure every ObjectId has the id string as a property for correct comparisons
+5 -3
View File
@@ -5,6 +5,8 @@
FROM node:24.14.1 AS base
WORKDIR /overleaf/services/history-v1
ENV PATH="/overleaf/node_modules/.bin:$PATH"
RUN corepack enable
COPY services/history-v1/install_deps.sh /overleaf/services/history-v1/
RUN chmod 0755 ./install_deps.sh && ./install_deps.sh
@@ -17,7 +19,7 @@ RUN mkdir /buckets && chown node:node /buckets
FROM base AS app
COPY package.json package-lock.json /overleaf/
COPY package.json yarn.lock .yarnrc.yml /overleaf/
COPY libraries/fetch-utils/package.json /overleaf/libraries/fetch-utils/package.json
COPY libraries/logger/package.json /overleaf/libraries/logger/package.json
COPY libraries/metrics/package.json /overleaf/libraries/metrics/package.json
@@ -32,10 +34,10 @@ COPY libraries/stream-utils/package.json /overleaf/libraries/stream-utils/packag
COPY libraries/validation-tools/package.json /overleaf/libraries/validation-tools/package.json
COPY services/history-v1/package.json /overleaf/services/history-v1/package.json
COPY tools/migrations/package.json /overleaf/tools/migrations/package.json
COPY patches/ /overleaf/patches/
COPY .yarn/patches/ /overleaf/.yarn/patches/
COPY tools/migrations/ /overleaf/tools/migrations/
RUN cd /overleaf && npm ci --quiet
RUN cd /overleaf && yarn workspaces focus overleaf-editor overleaf
COPY libraries/fetch-utils/ /overleaf/libraries/fetch-utils/
COPY libraries/logger/ /overleaf/libraries/logger/
COPY libraries/metrics/ /overleaf/libraries/metrics/
+12 -12
View File
@@ -15,7 +15,7 @@ IMAGE_REPO ?= us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME)
IMAGE_REPO_FINAL ?= $(IMAGE_REPO):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER)
IMAGE_CACHE ?= $(IMAGE_REPO):cache-$(shell cat \
$(MONOREPO)/package.json \
$(MONOREPO)/package-lock.json \
$(MONOREPO)/yarn.lock \
$(MONOREPO)/libraries/fetch-utils/package.json \
$(MONOREPO)/libraries/logger/package.json \
$(MONOREPO)/libraries/metrics/package.json \
@@ -30,7 +30,7 @@ IMAGE_CACHE ?= $(IMAGE_REPO):cache-$(shell cat \
$(MONOREPO)/libraries/validation-tools/package.json \
$(MONOREPO)/services/history-v1/package.json \
$(MONOREPO)/tools/migrations/package.json \
$(MONOREPO)/patches/* \
$(MONOREPO)/.yarn/patches/* \
| sha256sum | cut -d '-' -f1)
DOCKER_COMPOSE_FLAGS ?= -f docker-compose.yml
@@ -57,11 +57,11 @@ 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) --user node node:24.14.1 npm run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) --user node node:24.14.1 npm run --silent
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) -e PATH=$(MONOREPO)/node_modules/.bin:$$PATH --user node node:24.14.1 corepack yarn run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) -e PATH=$(MONOREPO)/node_modules/.bin:$$PATH --user node node:24.14.1 corepack yarn 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache $(IMAGE_CI) 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache -w /overleaf $(IMAGE_CI) 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache $(IMAGE_CI) corepack yarn 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache -w /overleaf $(IMAGE_CI) corepack yarn run --silent
SHELLCHECK_OPTS = \
--shell=bash \
@@ -100,19 +100,19 @@ $(WITH_CACHE_FOLDER): ../../node_modules/.cache/eslint/
mkdir -p $@
format:
$(RUN_LINTING_MONOREPO) format -- services/history-v1
$(RUN_LINTING_MONOREPO) format services/history-v1
format_ci:
$(RUN_LINTING_CI_MONOREPO) format -- services/history-v1
$(RUN_LINTING_CI_MONOREPO) format services/history-v1
format_fix:
$(RUN_LINTING_MONOREPO) format:fix -- services/history-v1
$(RUN_LINTING_MONOREPO) format:fix services/history-v1
lint:
$(RUN_LINTING) lint
lint_ci:
-$(RUN_LINTING_CI) lint -- --format json --output-file reports/eslint.json
-$(RUN_LINTING_CI) lint --format json --output-file reports/eslint.json
sed -i 's_"filePath":"/overleaf_"filePath":"$(MONOREPO)_g' reports/eslint.json
lint_fix:
@@ -150,7 +150,7 @@ endif
test_acceptance_run_debug:
ifneq (,$(wildcard test/acceptance))
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run -p 127.0.0.9:19999:19999 --rm test_acceptance npm run test:acceptance -- --inspect=0.0.0.0:19999 --inspect-brk
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run -p 127.0.0.9:19999:19999 --rm test_acceptance corepack yarn run --inspect=0.0.0.0:19999 --inspect-brk test:acceptance
endif
test_clean: test_acceptance_clean
@@ -163,7 +163,7 @@ ifneq (,$(wildcard test/acceptance/js/scripts/pre-run))
endif
benchmarks:
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run --rm test_acceptance npm run benchmarks
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run --rm test_acceptance corepack yarn run benchmarks
build:
docker build \
+1
View File
@@ -4,6 +4,7 @@ history-v1
--env-pass-through=
--esmock-loader=False
--node-version=24.14.1
--package-name=overleaf-editor
--pipeline-owner=44
--public-repo=False
--tsconfig-extra-includes=backup-deletion-app.mjs,backup-verifier-app.mjs,backup-worker-app.mjs,api/**/*,migrations/**/*,storage/**/*
+2 -2
View File
@@ -13,7 +13,7 @@ services:
- ./reports:/overleaf/services/history-v1/reports
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:unit:_run
command: yarn run test:unit:_run
environment:
CI:
MONGO_CONNECTION_STRING: mongodb://mongo/test-overleaf
@@ -77,7 +77,7 @@ services:
condition: service_healthy
user: node
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:acceptance
command: yarn run test:acceptance
tar:
build: .
+8 -2
View File
@@ -15,6 +15,9 @@ services:
- .:/overleaf/services/history-v1
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
working_dir: /overleaf/services/history-v1
@@ -30,7 +33,7 @@ services:
ANALYTICS_QUEUES_REDIS_HOST: redis_test
ANALYTICS_QUEUES_BQ_SINK_REDIS_HOST: redis_test
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run --silent test:unit
command: corepack yarn run --silent test:unit
user: node
depends_on:
mongo:
@@ -47,6 +50,9 @@ services:
- .:/overleaf/services/history-v1
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- minio-certs:/certs
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
@@ -91,7 +97,7 @@ services:
gcs:
condition: service_healthy
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run --silent test:acceptance
command: corepack yarn run --silent test:acceptance
redis_test:
image: redis:7.4.8
+14 -14
View File
@@ -7,17 +7,17 @@
"private": true,
"dependencies": {
"@google-cloud/secret-manager": "^5.6.0",
"@overleaf/fetch-utils": "*",
"@overleaf/logger": "*",
"@overleaf/metrics": "*",
"@overleaf/mongo-utils": "*",
"@overleaf/o-error": "*",
"@overleaf/object-persistor": "*",
"@overleaf/promise-utils": "*",
"@overleaf/redis-wrapper": "*",
"@overleaf/settings": "*",
"@overleaf/fetch-utils": "workspace:*",
"@overleaf/logger": "workspace:*",
"@overleaf/metrics": "workspace:*",
"@overleaf/mongo-utils": "workspace:*",
"@overleaf/o-error": "workspace:*",
"@overleaf/object-persistor": "workspace:*",
"@overleaf/promise-utils": "workspace:*",
"@overleaf/redis-wrapper": "workspace:*",
"@overleaf/settings": "workspace:*",
"@overleaf/stream-utils": "^0.1.0",
"@overleaf/validation-tools": "*",
"@overleaf/validation-tools": "workspace:*",
"archiver": "^5.3.0",
"basic-auth": "^2.0.1",
"bluebird": "^3.7.2",
@@ -36,7 +36,7 @@
"knex": "^2.4.0",
"lodash": "^4.17.19",
"mongodb": "6.12.0",
"overleaf-editor-core": "*",
"overleaf-editor-core": "workspace:*",
"p-limit": "^6.2.0",
"p-queue": "^8.1.0",
"pg": "^8.7.1",
@@ -47,7 +47,7 @@
"utf-8-validate": "^5.0.4"
},
"devDependencies": {
"@overleaf/migrations": "*",
"@overleaf/migrations": "workspace:*",
"benny": "^3.7.1",
"chai": "^4.3.6",
"chai-as-promised": "^7.1.1",
@@ -64,8 +64,8 @@
"start": "node app.js",
"lint": "eslint --cache --cache-location ../../node_modules/.cache/eslint/ --max-warnings 0 --format unix .",
"lint:fix": "eslint --cache --cache-location ../../node_modules/.cache/eslint/ --fix .",
"test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP",
"test:acceptance": "npm run test:acceptance:_run -- --grep=$MOCHA_GREP",
"test:unit": "yarn run test:unit:_run -- --grep=$MOCHA_GREP",
"test:acceptance": "yarn run test:acceptance:_run -- --grep=$MOCHA_GREP",
"test:unit:_run": "mocha --recursive --exit $@ test/unit/js",
"test:acceptance:_run": "mocha --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js",
"nodemon": "node --watch app.js",
+5 -3
View File
@@ -5,6 +5,8 @@
FROM node:24.14.1 AS base
WORKDIR /overleaf/services/notifications
ENV PATH="/overleaf/node_modules/.bin:$PATH"
RUN corepack enable
# Google Cloud Storage needs a writable $HOME/.config for resumable uploads
# (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream)
@@ -12,7 +14,7 @@ RUN mkdir /home/node/.config && chown node:node /home/node/.config
FROM base AS app
COPY package.json package-lock.json /overleaf/
COPY package.json yarn.lock .yarnrc.yml /overleaf/
COPY libraries/fetch-utils/package.json /overleaf/libraries/fetch-utils/package.json
COPY libraries/logger/package.json /overleaf/libraries/logger/package.json
COPY libraries/metrics/package.json /overleaf/libraries/metrics/package.json
@@ -23,10 +25,10 @@ COPY libraries/settings/package.json /overleaf/libraries/settings/package.json
COPY libraries/validation-tools/package.json /overleaf/libraries/validation-tools/package.json
COPY services/notifications/package.json /overleaf/services/notifications/package.json
COPY tools/migrations/package.json /overleaf/tools/migrations/package.json
COPY patches/ /overleaf/patches/
COPY .yarn/patches/ /overleaf/.yarn/patches/
COPY tools/migrations/ /overleaf/tools/migrations/
RUN cd /overleaf && npm ci --quiet
RUN cd /overleaf && yarn workspaces focus @overleaf/notifications overleaf
COPY libraries/fetch-utils/ /overleaf/libraries/fetch-utils/
COPY libraries/logger/ /overleaf/libraries/logger/
COPY libraries/metrics/ /overleaf/libraries/metrics/
+12 -12
View File
@@ -15,7 +15,7 @@ IMAGE_REPO ?= us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME)
IMAGE_REPO_FINAL ?= $(IMAGE_REPO):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER)
IMAGE_CACHE ?= $(IMAGE_REPO):cache-$(shell cat \
$(MONOREPO)/package.json \
$(MONOREPO)/package-lock.json \
$(MONOREPO)/yarn.lock \
$(MONOREPO)/libraries/fetch-utils/package.json \
$(MONOREPO)/libraries/logger/package.json \
$(MONOREPO)/libraries/metrics/package.json \
@@ -26,7 +26,7 @@ IMAGE_CACHE ?= $(IMAGE_REPO):cache-$(shell cat \
$(MONOREPO)/libraries/validation-tools/package.json \
$(MONOREPO)/services/notifications/package.json \
$(MONOREPO)/tools/migrations/package.json \
$(MONOREPO)/patches/* \
$(MONOREPO)/.yarn/patches/* \
| sha256sum | cut -d '-' -f1)
DOCKER_COMPOSE_FLAGS ?= -f docker-compose.yml
@@ -53,11 +53,11 @@ 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) --user node node:24.14.1 npm run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) --user node node:24.14.1 npm run --silent
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) -e PATH=$(MONOREPO)/node_modules/.bin:$$PATH --user node node:24.14.1 corepack yarn run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) -e PATH=$(MONOREPO)/node_modules/.bin:$$PATH --user node node:24.14.1 corepack yarn 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache $(IMAGE_CI) 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache -w /overleaf $(IMAGE_CI) 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache $(IMAGE_CI) corepack yarn 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache -w /overleaf $(IMAGE_CI) corepack yarn run --silent
SHELLCHECK_OPTS = \
--shell=bash \
@@ -96,19 +96,19 @@ $(WITH_CACHE_FOLDER): ../../node_modules/.cache/eslint/
mkdir -p $@
format:
$(RUN_LINTING_MONOREPO) format -- services/notifications
$(RUN_LINTING_MONOREPO) format services/notifications
format_ci:
$(RUN_LINTING_CI_MONOREPO) format -- services/notifications
$(RUN_LINTING_CI_MONOREPO) format services/notifications
format_fix:
$(RUN_LINTING_MONOREPO) format:fix -- services/notifications
$(RUN_LINTING_MONOREPO) format:fix services/notifications
lint:
$(RUN_LINTING) lint
lint_ci:
-$(RUN_LINTING_CI) lint -- --format json --output-file reports/eslint.json
-$(RUN_LINTING_CI) lint --format json --output-file reports/eslint.json
sed -i 's_"filePath":"/overleaf_"filePath":"$(MONOREPO)_g' reports/eslint.json
lint_fix:
@@ -146,7 +146,7 @@ endif
test_acceptance_run_debug:
ifneq (,$(wildcard test/acceptance))
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run -p 127.0.0.9:19999:19999 --rm test_acceptance npm run test:acceptance -- --inspect=0.0.0.0:19999 --inspect-brk
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run -p 127.0.0.9:19999:19999 --rm test_acceptance corepack yarn run --inspect=0.0.0.0:19999 --inspect-brk test:acceptance
endif
test_clean: test_acceptance_clean
@@ -159,7 +159,7 @@ ifneq (,$(wildcard test/acceptance/js/scripts/pre-run))
endif
benchmarks:
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run --rm test_acceptance npm run benchmarks
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run --rm test_acceptance corepack yarn run benchmarks
build:
docker build \
+1
View File
@@ -4,6 +4,7 @@ notifications
--env-pass-through=
--esmock-loader=False
--node-version=24.14.1
--package-name=@overleaf/notifications
--pipeline-owner=32
--public-repo=True
--test-acceptance-vitest=True
+2 -2
View File
@@ -11,7 +11,7 @@ services:
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tsconfig.backend.json:/overleaf/tsconfig.backend.json
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:unit:_run
command: yarn run test:unit:_run
environment:
CI:
MONGO_CONNECTION_STRING: mongodb://mongo/test-overleaf
@@ -42,7 +42,7 @@ services:
condition: service_started
user: node
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:acceptance
command: yarn run test:acceptance
tar:
build: .
+8 -2
View File
@@ -9,6 +9,9 @@ services:
- .:/overleaf/services/notifications
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
- ../../tsconfig.backend.json:/overleaf/tsconfig.backend.json
@@ -20,7 +23,7 @@ services:
NODE_ENV: test
NODE_OPTIONS: "--unhandled-rejections=strict"
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run --silent test:unit
command: corepack yarn run --silent test:unit
user: node
depends_on:
mongo:
@@ -32,6 +35,9 @@ services:
- .:/overleaf/services/notifications
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
- ../../tsconfig.backend.json:/overleaf/tsconfig.backend.json
@@ -49,7 +55,7 @@ services:
mongo:
condition: service_started
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run --silent test:acceptance
command: corepack yarn run --silent test:acceptance
mongo:
image: mongo:8.0.11
+11 -11
View File
@@ -7,9 +7,9 @@
"scripts": {
"start": "node app.ts",
"test:acceptance:_run": "vitest --config ./vitest.config.acceptance.cjs",
"test:acceptance": "npm run test:acceptance:_run",
"test:acceptance": "yarn run test:acceptance:_run",
"test:unit:_run": "vitest --config ./vitest.config.unit.cjs",
"test:unit": "npm run test:unit:_run",
"test:unit": "yarn run test:unit:_run",
"lint": "eslint --cache --cache-location ../../node_modules/.cache/eslint/ --max-warnings 0 --format unix .",
"lint:fix": "eslint --cache --cache-location ../../node_modules/.cache/eslint/ --fix .",
"types:check": "tsc --noEmit",
@@ -18,14 +18,14 @@
"author": "",
"license": "ISC",
"dependencies": {
"@overleaf/fetch-utils": "*",
"@overleaf/logger": "*",
"@overleaf/metrics": "*",
"@overleaf/mongo-utils": "*",
"@overleaf/o-error": "*",
"@overleaf/settings": "*",
"@overleaf/promise-utils": "*",
"@overleaf/validation-tools": "*",
"@overleaf/fetch-utils": "workspace:*",
"@overleaf/logger": "workspace:*",
"@overleaf/metrics": "workspace:*",
"@overleaf/mongo-utils": "workspace:*",
"@overleaf/o-error": "workspace:*",
"@overleaf/promise-utils": "workspace:*",
"@overleaf/settings": "workspace:*",
"@overleaf/validation-tools": "workspace:*",
"async": "^3.2.5",
"body-parser": "1.20.4",
"bunyan": "^1.8.15",
@@ -36,7 +36,7 @@
"zod-validation-error": "^4.0.1"
},
"devDependencies": {
"@overleaf/migrations": "*",
"@overleaf/migrations": "workspace:*",
"@types/method-override": "^3.0.0",
"chai": "^4.3.6",
"chai-as-promised": "^7.1.1",
+5 -3
View File
@@ -5,6 +5,8 @@
FROM node:24.14.1 AS base
WORKDIR /overleaf/services/project-history
ENV PATH="/overleaf/node_modules/.bin:$PATH"
RUN corepack enable
# Google Cloud Storage needs a writable $HOME/.config for resumable uploads
# (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream)
@@ -12,7 +14,7 @@ RUN mkdir /home/node/.config && chown node:node /home/node/.config
FROM base AS app
COPY package.json package-lock.json /overleaf/
COPY package.json yarn.lock .yarnrc.yml /overleaf/
COPY libraries/fetch-utils/package.json /overleaf/libraries/fetch-utils/package.json
COPY libraries/logger/package.json /overleaf/libraries/logger/package.json
COPY libraries/metrics/package.json /overleaf/libraries/metrics/package.json
@@ -26,10 +28,10 @@ COPY libraries/stream-utils/package.json /overleaf/libraries/stream-utils/packag
COPY libraries/validation-tools/package.json /overleaf/libraries/validation-tools/package.json
COPY services/project-history/package.json /overleaf/services/project-history/package.json
COPY tools/migrations/package.json /overleaf/tools/migrations/package.json
COPY patches/ /overleaf/patches/
COPY .yarn/patches/ /overleaf/.yarn/patches/
COPY tools/migrations/ /overleaf/tools/migrations/
RUN cd /overleaf && npm ci --quiet
RUN cd /overleaf && yarn workspaces focus @overleaf/project-history overleaf
COPY libraries/fetch-utils/ /overleaf/libraries/fetch-utils/
COPY libraries/logger/ /overleaf/libraries/logger/
COPY libraries/metrics/ /overleaf/libraries/metrics/
+12 -12
View File
@@ -15,7 +15,7 @@ IMAGE_REPO ?= us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME)
IMAGE_REPO_FINAL ?= $(IMAGE_REPO):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER)
IMAGE_CACHE ?= $(IMAGE_REPO):cache-$(shell cat \
$(MONOREPO)/package.json \
$(MONOREPO)/package-lock.json \
$(MONOREPO)/yarn.lock \
$(MONOREPO)/libraries/fetch-utils/package.json \
$(MONOREPO)/libraries/logger/package.json \
$(MONOREPO)/libraries/metrics/package.json \
@@ -29,7 +29,7 @@ IMAGE_CACHE ?= $(IMAGE_REPO):cache-$(shell cat \
$(MONOREPO)/libraries/validation-tools/package.json \
$(MONOREPO)/services/project-history/package.json \
$(MONOREPO)/tools/migrations/package.json \
$(MONOREPO)/patches/* \
$(MONOREPO)/.yarn/patches/* \
| sha256sum | cut -d '-' -f1)
DOCKER_COMPOSE_FLAGS ?= -f docker-compose.yml
@@ -56,11 +56,11 @@ 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) --user node node:24.14.1 npm run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) --user node node:24.14.1 npm run --silent
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) -e PATH=$(MONOREPO)/node_modules/.bin:$$PATH --user node node:24.14.1 corepack yarn run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) -e PATH=$(MONOREPO)/node_modules/.bin:$$PATH --user node node:24.14.1 corepack yarn 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache $(IMAGE_CI) 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache -w /overleaf $(IMAGE_CI) 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache $(IMAGE_CI) corepack yarn 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache -w /overleaf $(IMAGE_CI) corepack yarn run --silent
SHELLCHECK_OPTS = \
--shell=bash \
@@ -99,19 +99,19 @@ $(WITH_CACHE_FOLDER): ../../node_modules/.cache/eslint/
mkdir -p $@
format:
$(RUN_LINTING_MONOREPO) format -- services/project-history
$(RUN_LINTING_MONOREPO) format services/project-history
format_ci:
$(RUN_LINTING_CI_MONOREPO) format -- services/project-history
$(RUN_LINTING_CI_MONOREPO) format services/project-history
format_fix:
$(RUN_LINTING_MONOREPO) format:fix -- services/project-history
$(RUN_LINTING_MONOREPO) format:fix services/project-history
lint:
$(RUN_LINTING) lint
lint_ci:
-$(RUN_LINTING_CI) lint -- --format json --output-file reports/eslint.json
-$(RUN_LINTING_CI) lint --format json --output-file reports/eslint.json
sed -i 's_"filePath":"/overleaf_"filePath":"$(MONOREPO)_g' reports/eslint.json
lint_fix:
@@ -149,7 +149,7 @@ endif
test_acceptance_run_debug:
ifneq (,$(wildcard test/acceptance))
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run -p 127.0.0.9:19999:19999 --rm test_acceptance npm run test:acceptance -- --inspect=0.0.0.0:19999 --inspect-brk
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run -p 127.0.0.9:19999:19999 --rm test_acceptance corepack yarn run --inspect=0.0.0.0:19999 --inspect-brk test:acceptance
endif
test_clean: test_acceptance_clean
@@ -162,7 +162,7 @@ ifneq (,$(wildcard test/acceptance/js/scripts/pre-run))
endif
benchmarks:
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run --rm test_acceptance npm run benchmarks
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run --rm test_acceptance corepack yarn run benchmarks
build:
docker build \
+7 -7
View File
@@ -4,11 +4,11 @@ An API for converting raw editor updates into a compressed and browseable histor
## Running project-history
The app runs natively using npm and Node on the local system:
The app runs natively using yarn and Node on the local system:
```
npm install
npm run start
yarn install
yarn run start
```
## Unit Tests
@@ -20,7 +20,7 @@ Unit tests can be run in the `test_unit` container defined in `docker-compose.te
The makefile contains a short cut to run these:
```
make install # Only needs running once, or when npm packages are updated
make install # Only needs running once, or when yarn packages are updated
make test_unit
```
@@ -37,7 +37,7 @@ Acceptance tests are run against a live service, which runs in the `acceptance_t
To run the tests out-of-the-box, the makefile defines:
```
make install # Only needs running once, or when npm packages are updated
make install # Only needs running once, or when yarn packages are updated
make test_acceptance
```
@@ -57,10 +57,10 @@ 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 yarn 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.
The makefile contains a collection of shortcuts for running the npm scripts inside the appropriate docker containers, using the `docker-compose` files in the project.
The makefile contains a collection of shortcuts for running the yarn scripts inside the appropriate docker containers, using the `docker-compose` files in the project.
Copyright (c) Overleaf, 2017-2021.
+1
View File
@@ -4,5 +4,6 @@ project-history
--env-pass-through=
--esmock-loader=True
--node-version=24.14.1
--package-name=@overleaf/project-history
--pipeline-owner=44
--public-repo=False
@@ -10,7 +10,7 @@ services:
- ./reports:/overleaf/services/project-history/reports
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:unit:_run
command: yarn run test:unit:_run
environment:
CI:
MONGO_CONNECTION_STRING: mongodb://mongo/test-overleaf
@@ -53,7 +53,7 @@ services:
condition: service_healthy
user: node
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:acceptance
command: yarn run test:acceptance
tar:
build: .
+8 -2
View File
@@ -9,6 +9,9 @@ services:
- .:/overleaf/services/project-history
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
working_dir: /overleaf/services/project-history
@@ -24,7 +27,7 @@ services:
ANALYTICS_QUEUES_REDIS_HOST: redis_test
ANALYTICS_QUEUES_BQ_SINK_REDIS_HOST: redis_test
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run --silent test:unit
command: corepack yarn run --silent test:unit
user: node
depends_on:
mongo:
@@ -38,6 +41,9 @@ services:
- .:/overleaf/services/project-history
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
- ../../tools/migrations:/overleaf/tools/migrations
working_dir: /overleaf/services/project-history
@@ -61,7 +67,7 @@ services:
redis_test:
condition: service_healthy
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run --silent test:acceptance
command: corepack yarn run --silent test:acceptance
redis_test:
image: redis:7.4.8
+14 -14
View File
@@ -5,8 +5,8 @@
"main": "app.js",
"type": "module",
"scripts": {
"test:acceptance": "npm run test:acceptance:_run -- --grep=$MOCHA_GREP",
"test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP",
"test:acceptance": "yarn run test:acceptance:_run -- --grep=$MOCHA_GREP",
"test:unit": "yarn run test:unit:_run -- --grep=$MOCHA_GREP",
"start": "node app.js",
"nodemon": "node --watch app.js",
"test:acceptance:_run": "mocha --loader=esmock --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js",
@@ -16,16 +16,16 @@
"types:check": "tsc --noEmit"
},
"dependencies": {
"@overleaf/fetch-utils": "*",
"@overleaf/logger": "*",
"@overleaf/metrics": "*",
"@overleaf/mongo-utils": "*",
"@overleaf/o-error": "*",
"@overleaf/promise-utils": "*",
"@overleaf/redis-wrapper": "*",
"@overleaf/settings": "*",
"@overleaf/stream-utils": "*",
"@overleaf/validation-tools": "*",
"@overleaf/fetch-utils": "workspace:*",
"@overleaf/logger": "workspace:*",
"@overleaf/metrics": "workspace:*",
"@overleaf/mongo-utils": "workspace:*",
"@overleaf/o-error": "workspace:*",
"@overleaf/promise-utils": "workspace:*",
"@overleaf/redis-wrapper": "workspace:*",
"@overleaf/settings": "workspace:*",
"@overleaf/stream-utils": "workspace:*",
"@overleaf/validation-tools": "workspace:*",
"async": "^3.2.5",
"body-parser": "1.20.4",
"bunyan": "^1.8.15",
@@ -35,12 +35,12 @@
"lodash": "^4.17.20",
"minimist": "^1.2.8",
"mongodb-legacy": "6.1.3",
"overleaf-editor-core": "*",
"overleaf-editor-core": "workspace:*",
"p-queue": "^8.1.0",
"request": "2.88.2"
},
"devDependencies": {
"@overleaf/migrations": "*",
"@overleaf/migrations": "workspace:*",
"chai": "^4.3.6",
"chai-as-promised": "^7.1.1",
"esmock": "^2.7.3",
+5 -3
View File
@@ -5,6 +5,8 @@
FROM node:24.14.1 AS base
WORKDIR /overleaf/services/real-time
ENV PATH="/overleaf/node_modules/.bin:$PATH"
RUN corepack enable
# Google Cloud Storage needs a writable $HOME/.config for resumable uploads
# (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream)
@@ -12,7 +14,7 @@ RUN mkdir /home/node/.config && chown node:node /home/node/.config
FROM base AS app
COPY package.json package-lock.json /overleaf/
COPY package.json yarn.lock .yarnrc.yml /overleaf/
COPY libraries/fetch-utils/package.json /overleaf/libraries/fetch-utils/package.json
COPY libraries/logger/package.json /overleaf/libraries/logger/package.json
COPY libraries/metrics/package.json /overleaf/libraries/metrics/package.json
@@ -22,9 +24,9 @@ COPY libraries/redis-wrapper/package.json /overleaf/libraries/redis-wrapper/pack
COPY libraries/settings/package.json /overleaf/libraries/settings/package.json
COPY libraries/validation-tools/package.json /overleaf/libraries/validation-tools/package.json
COPY services/real-time/package.json /overleaf/services/real-time/package.json
COPY patches/ /overleaf/patches/
COPY .yarn/patches/ /overleaf/.yarn/patches/
RUN cd /overleaf && npm ci --quiet
RUN cd /overleaf && yarn workspaces focus @overleaf/real-time overleaf
COPY libraries/fetch-utils/ /overleaf/libraries/fetch-utils/
COPY libraries/logger/ /overleaf/libraries/logger/
COPY libraries/metrics/ /overleaf/libraries/metrics/
+12 -12
View File
@@ -15,7 +15,7 @@ IMAGE_REPO ?= us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME)
IMAGE_REPO_FINAL ?= $(IMAGE_REPO):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER)
IMAGE_CACHE ?= $(IMAGE_REPO):cache-$(shell cat \
$(MONOREPO)/package.json \
$(MONOREPO)/package-lock.json \
$(MONOREPO)/yarn.lock \
$(MONOREPO)/libraries/fetch-utils/package.json \
$(MONOREPO)/libraries/logger/package.json \
$(MONOREPO)/libraries/metrics/package.json \
@@ -25,7 +25,7 @@ IMAGE_CACHE ?= $(IMAGE_REPO):cache-$(shell cat \
$(MONOREPO)/libraries/settings/package.json \
$(MONOREPO)/libraries/validation-tools/package.json \
$(MONOREPO)/services/real-time/package.json \
$(MONOREPO)/patches/* \
$(MONOREPO)/.yarn/patches/* \
| sha256sum | cut -d '-' -f1)
DOCKER_COMPOSE_FLAGS ?= -f docker-compose.yml
@@ -52,11 +52,11 @@ 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) --user node node:24.14.1 npm run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) --user node node:24.14.1 npm run --silent
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) -e PATH=$(MONOREPO)/node_modules/.bin:$$PATH --user node node:24.14.1 corepack yarn run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) -e PATH=$(MONOREPO)/node_modules/.bin:$$PATH --user node node:24.14.1 corepack yarn 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache $(IMAGE_CI) 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache -w /overleaf $(IMAGE_CI) 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache $(IMAGE_CI) corepack yarn 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 --volume $(MONOREPO)/node_modules/.cache:/overleaf/node_modules/.cache -w /overleaf $(IMAGE_CI) corepack yarn run --silent
SHELLCHECK_OPTS = \
--shell=bash \
@@ -95,19 +95,19 @@ $(WITH_CACHE_FOLDER): ../../node_modules/.cache/eslint/
mkdir -p $@
format:
$(RUN_LINTING_MONOREPO) format -- services/real-time
$(RUN_LINTING_MONOREPO) format services/real-time
format_ci:
$(RUN_LINTING_CI_MONOREPO) format -- services/real-time
$(RUN_LINTING_CI_MONOREPO) format services/real-time
format_fix:
$(RUN_LINTING_MONOREPO) format:fix -- services/real-time
$(RUN_LINTING_MONOREPO) format:fix services/real-time
lint:
$(RUN_LINTING) lint
lint_ci:
-$(RUN_LINTING_CI) lint -- --format json --output-file reports/eslint.json
-$(RUN_LINTING_CI) lint --format json --output-file reports/eslint.json
sed -i 's_"filePath":"/overleaf_"filePath":"$(MONOREPO)_g' reports/eslint.json
lint_fix:
@@ -145,7 +145,7 @@ endif
test_acceptance_run_debug:
ifneq (,$(wildcard test/acceptance))
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run -p 127.0.0.9:19999:19999 --rm test_acceptance npm run test:acceptance -- --inspect=0.0.0.0:19999 --inspect-brk
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run -p 127.0.0.9:19999:19999 --rm test_acceptance corepack yarn run --inspect=0.0.0.0:19999 --inspect-brk test:acceptance
endif
test_clean: test_acceptance_clean
@@ -158,7 +158,7 @@ ifneq (,$(wildcard test/acceptance/js/scripts/pre-run))
endif
benchmarks:
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run --rm test_acceptance npm run benchmarks
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run --rm test_acceptance corepack yarn run benchmarks
build:
docker build \
+1
View File
@@ -4,6 +4,7 @@ real-time
--env-pass-through=
--esmock-loader=False
--node-version=24.14.1
--package-name=@overleaf/real-time
--pipeline-owner=32
--public-repo=False
--test-unit-vitest=True
+2 -2
View File
@@ -9,7 +9,7 @@ services:
volumes:
- ./reports:/overleaf/services/real-time/reports
- ../../tsconfig.backend.json:/overleaf/tsconfig.backend.json
command: npm run test:unit:_run
command: yarn run test:unit:_run
environment:
CI:
MONGO_CONNECTION_STRING: mongodb://mongo/test-overleaf
@@ -47,7 +47,7 @@ services:
redis_test:
condition: service_healthy
user: node
command: npm run test:acceptance
command: yarn run test:acceptance
tar:
build: .
+8 -2
View File
@@ -9,6 +9,9 @@ services:
- .:/overleaf/services/real-time
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
- ../../tsconfig.backend.json:/overleaf/tsconfig.backend.json
working_dir: /overleaf/services/real-time
environment:
@@ -22,7 +25,7 @@ services:
QUEUES_REDIS_HOST: redis_test
ANALYTICS_QUEUES_REDIS_HOST: redis_test
ANALYTICS_QUEUES_BQ_SINK_REDIS_HOST: redis_test
command: npm run --silent test:unit
command: corepack yarn run --silent test:unit
user: node
depends_on:
redis_test:
@@ -34,6 +37,9 @@ services:
- .:/overleaf/services/real-time
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
- ../../package.json:/overleaf/package.json
- ../../.yarnrc.yml:/overleaf/.yarnrc.yml
- ../../yarn.lock:/overleaf/yarn.lock
working_dir: /overleaf/services/real-time
environment:
RETRIES:
@@ -52,7 +58,7 @@ services:
depends_on:
redis_test:
condition: service_healthy
command: npm run --silent test:acceptance
command: corepack yarn run --silent test:acceptance
redis_test:
image: redis:7.4.8
+11 -11
View File
@@ -7,23 +7,23 @@
"scripts": {
"start": "node app.js",
"test:acceptance:_run": "mocha --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js",
"test:acceptance": "npm run test:acceptance:_run -- --grep=$MOCHA_GREP",
"test:acceptance": "yarn run test:acceptance:_run -- --grep=$MOCHA_GREP",
"test:unit:_run": "vitest --config ./vitest.config.unit.cjs",
"test:unit": "npm run test:unit:_run",
"test:unit": "yarn run test:unit:_run",
"nodemon": "node --watch app.js",
"lint": "eslint --cache --cache-location ../../node_modules/.cache/eslint/ --max-warnings 0 --format unix .",
"lint:fix": "eslint --cache --cache-location ../../node_modules/.cache/eslint/ --fix .",
"types:check": "tsc --noEmit"
},
"dependencies": {
"@overleaf/fetch-utils": "*",
"@overleaf/logger": "*",
"@overleaf/metrics": "*",
"@overleaf/o-error": "*",
"@overleaf/promise-utils": "*",
"@overleaf/redis-wrapper": "*",
"@overleaf/settings": "*",
"@overleaf/validation-tools": "*",
"@overleaf/fetch-utils": "workspace:*",
"@overleaf/logger": "workspace:*",
"@overleaf/metrics": "workspace:*",
"@overleaf/o-error": "workspace:*",
"@overleaf/promise-utils": "workspace:*",
"@overleaf/redis-wrapper": "workspace:*",
"@overleaf/settings": "workspace:*",
"@overleaf/validation-tools": "workspace:*",
"async": "^3.2.5",
"base64id": "0.1.0",
"body-parser": "1.20.4",
@@ -46,7 +46,7 @@
"mocha-junit-reporter": "^2.2.1",
"mocha-multi-reporters": "^1.5.1",
"sinon": "^9.2.4",
"sinon-chai": "^3.7.0",
"sinon-chai": "3.7.0",
"timekeeper": "0.0.4",
"typescript": "^5.0.4",
"uid-safe": "^2.1.5",
+25
View File
@@ -6,6 +6,31 @@ import sinonChai from 'sinon-chai'
// Chai configuration
chai.should()
chai.use(chaiAsPromised)
// Workaround: vitest's built-in chai plugins register spy-related properties
// (e.g. callCount) as getter-only via addChainableMethod. sinon-chai then tries
// to overwrite them via addMethod (plain property assignment), which fails.
// Pre-delete the conflicting getter-only properties so the assignment succeeds.
const sinonChaiMethodProps = [
'callCount',
'calledBefore',
'calledAfter',
'calledImmediatelyBefore',
'calledImmediatelyAfter',
'calledOn',
'calledWith',
'calledOnceWith',
'calledWithExactly',
'calledOnceWithExactly',
'calledWithMatch',
'returned',
'thrown',
]
for (const name of sinonChaiMethodProps) {
if (Object.getOwnPropertyDescriptor(chai.Assertion.prototype, name)?.get) {
delete chai.Assertion.prototype[name]
}
}
chai.use(sinonChai)
// Global stubs
+20 -6
View File
@@ -130,13 +130,27 @@ const config: StorybookConfig = {
},
module: {
...storybookConfig.module,
rules: (storybookConfig.module?.rules ?? []).concat({
test: /\.wasm$/,
type: 'asset/resource',
generator: {
filename: 'js/[name]-[contenthash][ext]',
rules: (storybookConfig.module?.rules ?? []).concat(
{
test: /\.wasm$/,
type: 'asset/resource',
generator: {
filename: 'js/[name]-[contenthash][ext]',
},
},
}),
{
// Disable webpack's `new URL()` processing for pdfjs-dist worker
// files, so that webpack does not try to resolve qcms_bg.wasm and
// openjpeg.wasm (which live in pdfjs-dist/wasm/, not build/).
// The main webpack build relies on a `/* webpackIgnore: true */`
// comment (via yarn patch) to achieve the same effect, but
// storybook's babel pipeline may strip comments from the 1.9 MB
// worker file (babel `compact: "auto"` removes comments for files
// > 500 KB), so we disable URL parsing for these files instead.
test: /pdfjs-dist.*pdf\.worker.*\.m?js$/,
parser: { javascript: { url: false } },
}
),
},
}
},
+10 -8
View File
@@ -4,6 +4,8 @@
FROM node:24.14.1 AS base
WORKDIR /overleaf/services/web
ENV PATH="/overleaf/node_modules/.bin:$PATH"
RUN corepack enable
# Google Cloud Storage needs a writable $HOME/.config for resumable uploads
# (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream)
@@ -22,10 +24,10 @@ RUN mkdir -p /overleaf/services/web/data/dumpFolder \
COPY services/web/certs/DigiCertGlobalG2TLSRSASHA2562020CA1-1.crt.pem /usr/local/share/ca-certificates/DigiCertGlobalG2TLSRSASHA2562020CA1-1.crt
RUN update-ca-certificates
# the deps image is used for caching npm ci
# the deps image is used for caching yarn workspaces focus
FROM base AS deps-prod
COPY package.json package-lock.json /overleaf/
COPY package.json yarn.lock .yarnrc.yml /overleaf/
COPY libraries/access-token-encryptor/package.json /overleaf/libraries/access-token-encryptor/package.json
COPY libraries/eslint-plugin/package.json /overleaf/libraries/eslint-plugin/package.json
COPY libraries/fetch-utils/package.json /overleaf/libraries/fetch-utils/package.json
@@ -43,16 +45,16 @@ COPY libraries/stream-utils/package.json /overleaf/libraries/stream-utils/packag
COPY libraries/validation-tools/package.json /overleaf/libraries/validation-tools/package.json
COPY services/web/package.json /overleaf/services/web/package.json
COPY tools/migrations/package.json /overleaf/tools/migrations/package.json
COPY patches/ /overleaf/patches/
COPY .yarn/patches/ /overleaf/.yarn/patches/
RUN cd /overleaf && NODE_ENV=production npm ci --quiet
RUN cd /overleaf && NODE_ENV=production yarn workspaces focus --production @overleaf/web
FROM deps-prod AS deps
ENV CYPRESS_INSTALL_BINARY=0
COPY tsconfig.backend.json /overleaf/
RUN cd /overleaf && npm install
RUN cd /overleaf && yarn workspaces focus @overleaf/web overleaf
# the dev is suitable for running tests
@@ -79,7 +81,7 @@ COPY services/web/ /overleaf/services/web/
COPY tools/migrations/ /overleaf/tools/migrations/
# Build the latex parser
RUN cd /overleaf/services/web && npm run 'lezer-latex:generate'
RUN cd /overleaf/services/web && yarn run 'lezer-latex:generate'
# The module folders are owned as root. The node user cannot create them. Create them in advance.
RUN cd /overleaf/services/web && make create_module_Makefiles
@@ -90,7 +92,7 @@ USER node
# the webpack image has deps+src+webpack artifacts
FROM dev AS webpack
USER root
RUN OVERLEAF_CONFIG=/overleaf/services/web/config/settings.webpack.js nice npm run webpack:production
RUN OVERLEAF_CONFIG=/overleaf/services/web/config/settings.webpack.js nice yarn run webpack:production
# intermediate image for removing source maps ahead of copying into final production image
@@ -120,7 +122,7 @@ COPY tools/migrations/ /overleaf/tools/migrations/
# Omit Server Pro/CE specific scripts from SaaS image
RUN rm /overleaf/services/web/modules/server-ce-scripts -rf
RUN OVERLEAF_CONFIG=/overleaf/services/web/config/settings.overrides.saas.js nice npm run precompile-pug
RUN OVERLEAF_CONFIG=/overleaf/services/web/config/settings.overrides.saas.js nice yarn run precompile-pug
# the web image with only production dependencies but no webpack production build, for development
+27 -26
View File
@@ -99,11 +99,11 @@ test_module: test_unit_module test_acceptance_module
test_unit: test_unit_all
test_unit_all: export COMPOSE_PROJECT_NAME=unit_test_all_$(BUILD_DIR_NAME)
test_unit_all: mongo_migrations_for_tests
$(DOCKER_COMPOSE) run --rm test_unit npm run test:unit:all
$(DOCKER_COMPOSE) run --rm test_unit yarn run test:unit:all
test_unit_all_silent: export COMPOSE_PROJECT_NAME=unit_test_all_$(BUILD_DIR_NAME)
test_unit_all_silent: mongo_migrations_for_tests
$(DOCKER_COMPOSE) run --rm test_unit npm run test:unit:all:silent
$(DOCKER_COMPOSE) run --rm test_unit yarn run test:unit:all:silent
test_unit_app: export COMPOSE_PROJECT_NAME=unit_test_$(BUILD_DIR_NAME)
test_unit_app: mongo_migrations_for_tests
@@ -112,16 +112,16 @@ test_unit_app: mongo_migrations_for_tests
test_unit_parallel: export JUNIT_ROOT_SUITE_NAME = ESM unit tests - parallel
test_unit_parallel: export COMPOSE_PROJECT_NAME=unit_test_parallel_$(BUILD_DIR_NAME)
test_unit_parallel: mongo_migrations_for_tests
$(DOCKER_COMPOSE) run --rm test_unit npm run test:unit:parallel
$(DOCKER_COMPOSE) run --rm test_unit yarn run test:unit:parallel
test_unit_sequential: export JUNIT_ROOT_SUITE_NAME = ESM unit tests - sequential
test_unit_sequential: export COMPOSE_PROJECT_NAME=unit_test_sequential_$(BUILD_DIR_NAME)
test_unit_sequential: mongo_migrations_for_tests
$(DOCKER_COMPOSE) run --rm test_unit npm run test:unit:sequential
$(DOCKER_COMPOSE) run --rm test_unit yarn run test:unit:sequential
test_unit_watch: export COMPOSE_PROJECT_NAME=unit_test_watch_$(BUILD_DIR_NAME)
test_unit_watch: mongo_migrations_for_tests
$(DOCKER_COMPOSE) run --rm test_unit npm run test:unit:watch
$(DOCKER_COMPOSE) run --rm test_unit yarn run test:unit:watch
TEST_SUITES = $(sort $(filter-out \
$(wildcard test/unit/src/helpers/*), \
@@ -155,7 +155,7 @@ test_unit_module: mongo_migrations_for_tests
$(MAKE) modules/$(MODULE_NAME)/test_unit
mongo_migrations_for_tests:
$(DOCKER_COMPOSE) run --rm --workdir /overleaf/tools/migrations test_unit npm run migrations -- migrate -t saas
$(DOCKER_COMPOSE) run --rm --workdir /overleaf/tools/migrations test_unit yarn run migrations migrate -t saas
#
# Frontend tests
@@ -249,10 +249,10 @@ TEST_ACCEPTANCE_APP := \
ifeq ($(DEBUG),true)
TEST_ACCEPTANCE_DEBUG_PORT := -p 127.0.0.1:19999:19999
TEST_ACCEPTANCE_NPM_SCRIPT := npm run --silent test:acceptance:app:debug
TEST_ACCEPTANCE_YARN_SCRIPT := yarn run --silent test:acceptance:app:debug
else
TEST_ACCEPTANCE_DEBUG_PORT :=
TEST_ACCEPTANCE_NPM_SCRIPT := npm run --silent test:acceptance:app
TEST_ACCEPTANCE_YARN_SCRIPT := yarn run --silent test:acceptance:app
endif
test_acceptance_app: $(TEST_ACCEPTANCE_APP)
@@ -267,7 +267,7 @@ test_acceptance_app_server_pro: export COMPOSE_PROJECT_NAME=acceptance_test_serv
test_acceptance_app_server_pro: export OVERLEAF_CONFIG=$(CFG_SERVER_PRO)
$(TEST_ACCEPTANCE_APP):
$(DOCKER_COMPOSE) run --rm $(TEST_ACCEPTANCE_DEBUG_PORT) test_acceptance $(TEST_ACCEPTANCE_NPM_SCRIPT)
$(DOCKER_COMPOSE) run --rm $(TEST_ACCEPTANCE_DEBUG_PORT) test_acceptance $(TEST_ACCEPTANCE_YARN_SCRIPT)
$(DOCKER_COMPOSE) down -v -t 0
# We are using _make magic_ for turning these file-targets into calls to
@@ -335,7 +335,7 @@ test_acceptance_module_maybe_in_server_pro: export BASE_CONFIG=$(CFG_SERVER_PRO)
# Either the grep will find and emit the module, or exits with code 1, which
# we handle with a fallback to a noop make target.
# Run the node command in a docker compose container which provides the needed
# npm dependencies (from disk in dev-env or from the CI image in CI).
# yarn dependencies (from disk in dev-env or from the CI image in CI).
# Pick the test_unit service which is very light-weight -- the test_acceptance
# service would start mongo/redis.
$(TEST_ACCEPTANCE_MODULE_MAYBE_IN): test_acceptance_module_maybe_in_%:
@@ -465,12 +465,12 @@ ci:
# Run the linting commands in the scope of the monorepo.
# Eslint and prettier (plus some configs) are on the root.
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/web/data/reports:/overleaf/services/web/data/reports --volume $(MONOREPO)/node_modules/.cache/:/overleaf/node_modules/.cache/ -w /overleaf $(IMAGE_CI) npm run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) --user node node:24.14.1 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/web/data/reports:/overleaf/services/web/data/reports --volume $(MONOREPO)/node_modules/.cache/:/overleaf/node_modules/.cache/ -w /overleaf $(IMAGE_CI) corepack yarn run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) --user node node:24.14.1 corepack yarn run --silent
ORG_PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RUN_LINT_FORMAT ?= \
docker run --rm --env BRANCH_NAME --env CI --env COMMIT_SHA --env MONOREPO --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume ${PWD}/data/reports:/overleaf/services/web/data/reports --volume $(MONOREPO)/node_modules/.cache/:/overleaf/node_modules/.cache/ ${IMAGE_CI}
docker run --rm --env BRANCH_NAME --env CI --env COMMIT_SHA --env MONOREPO --env PATH=/overleaf/node_modules/.bin:$(ORG_PATH) --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume ${PWD}/data/reports:/overleaf/services/web/data/reports --volume $(MONOREPO)/node_modules/.cache/:/overleaf/node_modules/.cache/ ${IMAGE_CI}
NODE_MODULES_PATH := ${PATH}:${PWD}/node_modules/.bin:/overleaf/services/web/node_modules/.bin
WITH_NODE_MODULES_PATH = \
@@ -515,19 +515,19 @@ $(WITH_CACHE_FOLDER): ../../node_modules/.cache/stylelint/
lint: lint_eslint
lint_eslint:
ifeq ($(CI),true)
-npm run lint -- --format json --output-file data/reports/eslint.json
-yarn run lint --format json --output-file data/reports/eslint.json
sed -i 's_"filePath":"/overleaf_"filePath":"$(MONOREPO)_g' data/reports/eslint.json
else
npm run lint
yarn run lint
endif
lint: lint_stylelint
lint_stylelint:
ifeq ($(CI),true)
-npm run lint:styles -- --formatter json --output-file data/reports/stylelint.json
-yarn run lint:styles --formatter json --output-file data/reports/stylelint.json
sed -i 's_"source":"/overleaf_"source":"$(MONOREPO)_g' data/reports/stylelint.json
else
npm run lint:styles
yarn run lint:styles
endif
lint_stylelint_fix:
@@ -561,24 +561,24 @@ lint_overleafModuleImports:
lint: typecheck_frontend
typecheck_frontend:
npm run --silent type-check
yarn run --silent type-check
lint: typecheck_backend
typecheck_backend:
npm run --silent type-check:backend
yarn run --silent type-check:backend
lint_in_docker:
$(RUN_LINT_FORMAT) make lint -j2 --output-sync
format: format_js
format_js:
$(RUN_LINTING_MONOREPO) format -- services/web
$(RUN_LINTING_MONOREPO) format services/web
format_ci:
$(RUN_LINTING_CI_MONOREPO) format -- services/web
$(RUN_LINTING_CI_MONOREPO) format services/web
format_fix:
$(RUN_LINTING_MONOREPO) format:fix -- services/web
$(RUN_LINTING_MONOREPO) format:fix services/web
format_styles:
$(RUN_LINTING_MONOREPO) format:styles
@@ -599,7 +599,7 @@ format_jenkins_fix:
$(RUN_LINTING_MONOREPO) format:jenkins:fix
format_in_docker:
$(RUN_LINT_FORMAT) npm run --prefix /overleaf format -- services/web
$(RUN_LINT_FORMAT) bash -c 'cd /overleaf && yarn run format services/web'
SHELLCHECK_OPTS = \
--shell=bash \
@@ -632,7 +632,7 @@ IMAGE_REPO_FINAL ?= $(IMAGE_REPO):$(BRANCH_NAME_TAG_SAFE)-$(BUILD_NUMBER)
IMAGE_SCRATCH ?= $(IMAGE_REPO):do-not-use-this-tag-for-deploys--it-is-used-for-early-pushes-in-ci
IMAGE_CACHE ?= $(IMAGE_REPO):cache-$(shell cat \
$(MONOREPO)/package.json \
$(MONOREPO)/package-lock.json \
$(MONOREPO)/yarn.lock \
$(MONOREPO)/libraries/access-token-encryptor/package.json \
$(MONOREPO)/libraries/eslint-plugin/package.json \
$(MONOREPO)/libraries/fetch-utils/package.json \
@@ -727,9 +727,10 @@ tar:
COMPOSE_PROJECT_NAME=tar_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) down -v -t 0
build_storybook:
npm run lezer-latex:generate
yarn run lezer-latex:generate
mkdir -p data/storybook/
npm run build-storybook -- --output-dir data/storybook/$(BRANCH_NAME) --loglevel warn --quiet
rm -rf data/storybook/$(BRANCH_NAME)
yarn run build-storybook --output-dir data/storybook/$(BRANCH_NAME) --loglevel warn --quiet
storybook_index:
mkdir -p data/storybook/
+3 -3
View File
@@ -10,11 +10,11 @@ The rest of the Overleaf stack, along with information about contributing can be
### Running the app
The app runs natively using npm and Node on the local system:
The app runs natively using yarn and Node on the local system:
```
$ npm install
$ npm run start
$ yarn install
$ yarn run start
```
### Running Tests
+1 -1
View File
@@ -4,7 +4,7 @@ import { webpackConfig } from './cypress/support/webpack.cypress'
let reporterOptions = {}
if (process.env.CI) {
reporterOptions = {
reporter: '/overleaf/node_modules/cypress-multi-reporters',
reporter: 'cypress-multi-reporters',
reporterOptions: {
configFile: 'cypress/cypress-multi-reporters.json',
},
+5 -5
View File
@@ -15,7 +15,7 @@ services:
- ./data/coverage:/overleaf/services/web/data/coverage
- ./data/reports:/overleaf/services/web/data/reports
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:unit:app
command: yarn run test:unit:app
working_dir: /overleaf/services/web
env_file: docker-compose.common.env
environment:
@@ -60,7 +60,7 @@ services:
- ./data/coverage:/overleaf/services/web/data/coverage
- ./data/reports:/overleaf/services/web/data/reports
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:acceptance:app
command: yarn run test:acceptance:app
depends_on:
- redis_test
- mongo
@@ -80,7 +80,7 @@ services:
driver: local
user: node
working_dir: /overleaf/services/web
command: npm run test:frontend
command: yarn run test:frontend
environment:
NODE_OPTIONS: "--unhandled-rejections=strict"
CI:
@@ -104,7 +104,7 @@ services:
volumes:
- /dev/shm/overleaf:/overleaf
- ./data/reports:/overleaf/services/web/data/reports
entrypoint: npm
entrypoint: yarn
command:
- "run"
- "cypress:run-ct"
@@ -118,7 +118,7 @@ services:
driver: local
user: node
working_dir: /overleaf/services/web
command: npm run test:writefull
command: yarn run test:writefull
volumes:
- ./data/reports:/overleaf/services/web/data/reports
environment:
+1 -1
View File
@@ -10,7 +10,7 @@ services:
- /tmp/.X11-unix:/tmp/.X11-unix
- ${XAUTHORITY:-/dev/null}:/home/node/.Xauthority
working_dir: /overleaf/services/web
entrypoint: npm
entrypoint: yarn
command: run cypress:open-ct
environment:
VERBOSE_LOGGING:
+4 -4
View File
@@ -26,7 +26,7 @@ services:
REDIS_HOST: redis_test
MONOREPO:
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run --silent test:unit:app
command: corepack yarn run --silent test:unit:app
user: node
depends_on:
- mongo
@@ -67,7 +67,7 @@ services:
- saml
- ldap
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run --silent test:acceptance:app
command: corepack yarn run --silent test:acceptance:app
test_frontend_jsdom:
build:
@@ -85,7 +85,7 @@ services:
MOCHA_GREP: ${MOCHA_GREP}
NODE_OPTIONS: "--unhandled-rejections=strict"
VERBOSE_LOGGING:
command: npm run --silent test:frontend
command: corepack yarn run --silent test:frontend
user: node
test_frontend_ct:
@@ -123,7 +123,7 @@ services:
JUNIT_ROOT_SUITE_NAME:
NODE_OPTIONS: "--unhandled-rejections=strict"
VERBOSE_LOGGING:
command: npm run --silent test:writefull
command: corepack yarn run --silent test:writefull
user: node
redis_test:
@@ -40,7 +40,7 @@ From the monorepo root:
make install
# manually
bin/npm -w services/web run 'lezer-latex:generate'
bin/yarn -w services/web run 'lezer-latex:generate'
```
## Tests
@@ -65,7 +65,7 @@ some example files in the test suite, at `web/test/unit/src/LezerLatex/examples/
For example:
```sh
bin/npm -w services/web run 'lezer-latex:run' web/test/unit/src/LezerLatex/examples/amsmath.tex
bin/yarn -w services/web run 'lezer-latex:run' web/test/unit/src/LezerLatex/examples/amsmath.tex
```
If you omit the file path, the default file (`examples/demo.tex`) will be run.
+61 -61
View File
@@ -8,19 +8,19 @@
},
"scripts": {
"test:acceptance:run_dir": "bin/test_acceptance_run_dir",
"test:acceptance:app": "npm run test:acceptance:run_dir -- test/acceptance/src",
"test:acceptance:app:debug": "npm run test:acceptance:debug:run_dir -- test/acceptance/src",
"test:acceptance:debug:run_dir": "mocha --recursive --timeout 25000 --grep=$MOCHA_GREP --require test/acceptance/bootstrap.js --inspect=0.0.0.0:19999 --inspect-brk",
"test:acceptance:app": "yarn run test:acceptance:run_dir -- test/acceptance/src",
"test:acceptance:app:debug": "yarn run test:acceptance:debug:run_dir -- test/acceptance/src",
"test:acceptance:debug:run_dir": "mocha --recursive --timeout 25000 --grep=${MOCHA_GREP:-} --require test/acceptance/bootstrap.js --inspect=0.0.0.0:19999 --inspect-brk",
"test:unit:run_dir": "bin/test_unit_run_dir",
"test:unit:all": "npm run test:unit:run_dir -- test/unit/src modules/*/test/unit/src",
"test:unit:all:silent": "npm run test:unit:all -- --reporter dot",
"test:unit:app": "npm run test:unit:run_dir -- test/unit/src",
"test:unit:all": "yarn run test:unit:run_dir -- test/unit/src modules/*/test/unit/src",
"test:unit:all:silent": "yarn run test:unit:all -- --reporter dot",
"test:unit:app": "yarn run test:unit:run_dir -- test/unit/src",
"test:unit": "vitest run",
"test:unit:parallel": "vitest run --project=Parallel",
"test:unit:sequential": "vitest run --project=Sequential",
"test:unit:watch": "vitest",
"test:frontend": "NODE_ENV=test TZ=GMT mocha --recursive --timeout 5000 --exit --extension js,jsx,mjs,ts,tsx --grep=$MOCHA_GREP --require test/frontend/bootstrap.js --ignore '**/*.spec.{js,jsx,ts,tsx}' --ignore '**/helpers/**/*.{js,jsx,ts,tsx}' test/frontend modules/*/test/frontend",
"test:frontend:coverage": "c8 --all --include 'frontend/js' --include 'modules/*/frontend/js' --exclude 'frontend/js/vendor' --reporter=lcov --reporter=text-summary npm run test:frontend",
"test:frontend": "NODE_ENV=test TZ=GMT mocha --recursive --timeout 5000 --exit --extension js,jsx,mjs,ts,tsx --grep=${MOCHA_GREP:-} --require test/frontend/bootstrap.js --ignore '**/*.spec.{js,jsx,ts,tsx}' --ignore '**/helpers/**/*.{js,jsx,ts,tsx}' test/frontend modules/*/test/frontend",
"test:frontend:coverage": "c8 --all --include 'frontend/js' --include 'modules/*/frontend/js' --exclude 'frontend/js/vendor' --reporter=lcov --reporter=text-summary yarn run test:frontend",
"test:writefull": "vitest --run --config modules/writefull/frontend/js/integration/vitest.config.ts",
"start": "node app.mjs",
"nodemon": "node --watch app.mjs --watch-locales",
@@ -35,10 +35,10 @@
"type-check:backend": "tsc -p tsconfig.backend.json --noEmit",
"extract-translations": "i18next-scanner",
"convert-themes": "node frontend/js/features/source-editor/themes/scripts/convert.js",
"cypress:open-ct": "OVERLEAF_CONFIG=$PWD/config/settings.webpack.js cypress open --component",
"cypress:run-ct": "OVERLEAF_CONFIG=$PWD/config/settings.webpack.js cypress run --component --browser chrome",
"cypress:docker:open-ct": "USER_UID=$(id -u) USER_GID=$(id -g) docker compose -f docker-compose.cypress.yml run --rm cypress run cypress:open-ct",
"cypress:docker:run-ct": "USER_UID=$(id -u) USER_GID=$(id -g) docker compose -f docker-compose.cypress.yml run --rm cypress run cypress:run-ct --browser chrome",
"cypress:open-ct": "OVERLEAF_CONFIG=$(pwd)/config/settings.webpack.js cypress open --component",
"cypress:run-ct": "OVERLEAF_CONFIG=$(pwd)/config/settings.webpack.js cypress run --component --browser chrome",
"cypress:docker:open-ct": "USER_UID=$(id -u) USER_GID=$(id -g) docker compose -f docker-compose.cypress.yml run --rm cypress yarn run cypress:open-ct",
"cypress:docker:run-ct": "USER_UID=$(id -u) USER_GID=$(id -g) docker compose -f docker-compose.cypress.yml run --rm cypress yarn run cypress:run-ct --browser chrome",
"lezer-latex:generate": "node scripts/lezer-latex/generate.mjs",
"lezer-latex:run": "node scripts/lezer-latex/run.mjs",
"lezer-latex:benchmark": "node scripts/lezer-latex/benchmark.mjs",
@@ -48,24 +48,24 @@
"build-storybook": "storybook build",
"build-unfilled-fonts": "node frontend/fonts/material-symbols/build-unfilled.mjs",
"precompile-pug": "node app/src/infrastructure/Views.mjs",
"local:nodemon": "set -a;. ../../config/dev-environment.env;. ./docker-compose.common.env;. ../../config/local-dev.env;. ./local-dev.env;. ../../config/local.env;. ../../config/domain.env; set +a; echo $OVERLEAF_CONFIG; WEB_PORT=13000 LISTEN_ADDRESS=0.0.0.0 npm run nodemon",
"local:webpack": "set -a;. ../../config/dev-environment.env;. ./docker-compose.common.env;. ../../config/local-dev.env;. ./local-dev.env;. ../../config/local.env;. ../../config/domain.env; set +a; PORT=13808 OVERLEAF_CONFIG=$(pwd)/config/settings.webpack.js npm run webpack",
"local:test:acceptance:run_dir": "set -a;. $(pwd)/docker-compose.common.env;. $(pwd)/local-test.env; set +a; npm run test:acceptance:run_dir",
"local:test:acceptance:run_app": "OVERLEAF_CONFIG=$(pwd)/test/acceptance/config/settings.test.${OVERLEAF_APP}.js npm run local:test:acceptance:run_dir -- $(pwd)/test/acceptance/src",
"local:test:acceptance:run_module": "if [ ! -d $(pwd)/modules/${MODULE}/test/acceptance ]; then echo \"Module '${MODULE}' does not have acceptance tests\"; exit 0; fi; OVERLEAF_CONFIG=$(pwd)/modules/${MODULE}/test/acceptance/config/settings.test.js BASE_CONFIG=$(pwd)/test/acceptance/config/settings.test.${OVERLEAF_APP}.js npm run local:test:acceptance:run_dir -- $(pwd)/modules/${MODULE}/test/acceptance",
"local:test:acceptance:run_modules": "OVERLEAF_CONFIG=$(pwd)/test/acceptance/config/settings.test.${OVERLEAF_APP}.js node $(pwd)/test/acceptance/getModuleTargets --name-only | xargs -n1 sh -c 'MODULE=$0 npm run local:test:acceptance:run_module || exit 255' $1",
"local:test:acceptance:app:saas": "OVERLEAF_APP=saas npm run local:test:acceptance:run_app",
"local:test:acceptance:app:server-pro": "OVERLEAF_APP=server-pro npm run local:test:acceptance:run_app",
"local:test:acceptance:app:server-ce": "OVERLEAF_APP=server-ce npm run local:test:acceptance:run_app",
"local:test:acceptance:app": "echo saas server-pro server-ce | xargs -n1 sh -c 'npm run local:test:acceptance:app:${0} || exit 255'",
"local:test:acceptance:modules:saas": "OVERLEAF_APP=saas npm run local:test:acceptance:run_modules",
"local:test:acceptance:modules:server-pro": "OVERLEAF_APP=server-pro npm run local:test:acceptance:run_modules",
"local:test:acceptance:modules:server-ce": "OVERLEAF_APP=server-ce npm run local:test:acceptance:run_modules",
"local:test:acceptance:modules": "echo saas server-ce server-pro | xargs -n1 sh -c 'npm run local:test:acceptance:modules:${0} || exit 255'",
"local:test:acceptance": "npm run local:test:acceptance:app && npm run local:test:acceptance:modules",
"local:test:unit": "npm run test:unit:all",
"local:test:frontend": "npm run test:frontend",
"local:test": "npm run local:test:unit && npm run local:test:frontend && npm run local:test:acceptance",
"local:nodemon": "set -a;. ../../config/dev-environment.env;. ./docker-compose.common.env;. ../../config/local-dev.env;. ./local-dev.env;. ../../config/local.env;. ../../config/domain.env; set +a; echo $OVERLEAF_CONFIG; WEB_PORT=13000 LISTEN_ADDRESS=0.0.0.0 yarn run nodemon",
"local:webpack": "set -a;. ../../config/dev-environment.env;. ./docker-compose.common.env;. ../../config/local-dev.env;. ./local-dev.env;. ../../config/local.env;. ../../config/domain.env; set +a; PORT=13808 OVERLEAF_CONFIG=$(pwd)/config/settings.webpack.js yarn run webpack",
"local:test:acceptance:run_dir": "set -a;. $(pwd)/docker-compose.common.env;. $(pwd)/local-test.env; set +a; yarn run test:acceptance:run_dir",
"local:test:acceptance:run_app": "OVERLEAF_CONFIG=$(pwd)/test/acceptance/config/settings.test.${OVERLEAF_APP}.js yarn run local:test:acceptance:run_dir -- $(pwd)/test/acceptance/src",
"local:test:acceptance:run_module": "if [ ! -d $(pwd)/modules/${MODULE}/test/acceptance ]; then echo \"Module '${MODULE}' does not have acceptance tests\"; exit 0; fi; OVERLEAF_CONFIG=$(pwd)/modules/${MODULE}/test/acceptance/config/settings.test.js BASE_CONFIG=$(pwd)/test/acceptance/config/settings.test.${OVERLEAF_APP}.js yarn run local:test:acceptance:run_dir -- $(pwd)/modules/${MODULE}/test/acceptance",
"local:test:acceptance:run_modules": "OVERLEAF_CONFIG=$(pwd)/test/acceptance/config/settings.test.${OVERLEAF_APP}.js node $(pwd)/test/acceptance/getModuleTargets --name-only | xargs -n1 sh -c 'MODULE=$0 yarn run local:test:acceptance:run_module || exit 255' $1",
"local:test:acceptance:app:saas": "OVERLEAF_APP=saas yarn run local:test:acceptance:run_app",
"local:test:acceptance:app:server-pro": "OVERLEAF_APP=server-pro yarn run local:test:acceptance:run_app",
"local:test:acceptance:app:server-ce": "OVERLEAF_APP=server-ce yarn run local:test:acceptance:run_app",
"local:test:acceptance:app": "echo saas server-pro server-ce | xargs -n1 sh -c 'yarn run local:test:acceptance:app:${0} || exit 255'",
"local:test:acceptance:modules:saas": "OVERLEAF_APP=saas yarn run local:test:acceptance:run_modules",
"local:test:acceptance:modules:server-pro": "OVERLEAF_APP=server-pro yarn run local:test:acceptance:run_modules",
"local:test:acceptance:modules:server-ce": "OVERLEAF_APP=server-ce yarn run local:test:acceptance:run_modules",
"local:test:acceptance:modules": "echo saas server-ce server-pro | xargs -n1 sh -c 'yarn run local:test:acceptance:modules:${0} || exit 255'",
"local:test:acceptance": "yarn run local:test:acceptance:app && yarn run local:test:acceptance:modules",
"local:test:unit": "yarn run test:unit:all",
"local:test:frontend": "yarn run test:frontend",
"local:test": "yarn run local:test:unit && yarn run local:test:frontend && yarn run local:test:acceptance",
"knip": "knip --config knip.ts"
},
"browserslist": [
@@ -84,19 +84,19 @@
"@google-cloud/storage": "^7.19.0",
"@node-oauth/oauth2-server": "^5.3.0",
"@node-saml/passport-saml": "^5.1.0",
"@overleaf/access-token-encryptor": "*",
"@overleaf/fetch-utils": "*",
"@overleaf/logger": "*",
"@overleaf/metrics": "*",
"@overleaf/migrations": "*",
"@overleaf/mongo-utils": "*",
"@overleaf/o-error": "*",
"@overleaf/object-persistor": "*",
"@overleaf/promise-utils": "*",
"@overleaf/redis-wrapper": "*",
"@overleaf/settings": "*",
"@overleaf/stream-utils": "*",
"@overleaf/validation-tools": "*",
"@overleaf/access-token-encryptor": "workspace:*",
"@overleaf/fetch-utils": "workspace:*",
"@overleaf/logger": "workspace:*",
"@overleaf/metrics": "workspace:*",
"@overleaf/migrations": "workspace:*",
"@overleaf/mongo-utils": "workspace:*",
"@overleaf/o-error": "workspace:*",
"@overleaf/object-persistor": "workspace:*",
"@overleaf/promise-utils": "workspace:*",
"@overleaf/redis-wrapper": "workspace:*",
"@overleaf/settings": "workspace:*",
"@overleaf/stream-utils": "workspace:*",
"@overleaf/validation-tools": "workspace:*",
"@phosphor-icons/react": "^2.1.7",
"@phosphor-icons/webcomponents": "^2.1.5",
"@slack/webhook": "^7.0.2",
@@ -140,7 +140,7 @@
"helmet": "^6.0.1",
"https-proxy-agent": "^7.0.6",
"i18next": "^23.10.0",
"i18next-fs-backend": "^2.3.1",
"i18next-fs-backend": "2.6.1",
"i18next-http-middleware": "^3.5.0",
"jose": "^4.3.8",
"json2csv": "^4.3.3",
@@ -161,7 +161,7 @@
"nodemailer": "^7.0.0",
"on-headers": "^1.0.2",
"otplib": "^12.0.1",
"overleaf-editor-core": "*",
"overleaf-editor-core": "workspace:*",
"p-limit": "^2.3.0",
"p-props": "4.0.0",
"p-queue": "^8.1.0",
@@ -177,7 +177,7 @@
"rate-limiter-flexible": "^2.4.1",
"react-hook-form": "^7.71.1",
"recurly": "^4.0.0",
"referer-parser": "github:overleaf/nodejs-referer-parser#8b8b103762d05b7be4cfa2f810e1d408be67d7bb",
"referer-parser": "patch:referer-parser@npm%3A0.0.3#~/.yarn/patches/referer-parser-npm-0.0.3.patch",
"request": "2.88.2",
"requestretry": "7.1.0",
"sanitize-html": "^2.8.1",
@@ -203,13 +203,13 @@
"@babel/preset-react": "^7.28.5",
"@babel/preset-typescript": "^7.28.5",
"@babel/register": "^7.28.3",
"@codemirror/autocomplete": "github:overleaf/codemirror-autocomplete#6445cd056671c98d12d1c597ba705e11327ec4c5",
"@codemirror/autocomplete": "6.18.4",
"@codemirror/commands": "6.10.1",
"@codemirror/lang-markdown": "6.5.0",
"@codemirror/lang-python": "6.2.1",
"@codemirror/language": "6.12.1",
"@codemirror/lint": "6.9.2",
"@codemirror/search": "github:overleaf/codemirror-search#04380a528c339cd4b78fb10b3ef017f657ec17bd",
"@codemirror/search": "6.5.8",
"@codemirror/state": "6.5.4",
"@codemirror/view": "6.38.6",
"@floating-ui/react": "^0.27.5",
@@ -222,9 +222,9 @@
"@lezer/markdown": "1.6.3",
"@overleaf/codemirror-tree-view": "^0.1.3",
"@overleaf/dictionaries": "https://github.com/overleaf/dictionaries/archive/refs/tags/v0.0.3.tar.gz",
"@overleaf/eslint-plugin": "*",
"@overleaf/ranges-tracker": "*",
"@overleaf/stream-utils": "*",
"@overleaf/eslint-plugin": "workspace:*",
"@overleaf/ranges-tracker": "workspace:*",
"@overleaf/stream-utils": "workspace:*",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.16",
"@pollyjs/adapter-node-http": "^6.0.6",
"@pollyjs/core": "^6.0.6",
@@ -275,13 +275,13 @@
"@types/utf-8-validate": "^5.0.2",
"@types/uuid": "^9.0.8",
"@uppy/core": "^3.8.0",
"@uppy/dashboard": "^3.7.1",
"@uppy/drag-drop": "^3.0.3",
"@uppy/file-input": "^3.0.4",
"@uppy/progress-bar": "^3.0.4",
"@uppy/react": "^3.2.1",
"@uppy/dashboard": "3.7.1",
"@uppy/drag-drop": "3.0.3",
"@uppy/file-input": "3.0.4",
"@uppy/progress-bar": "3.0.4",
"@uppy/react": "3.2.1",
"@uppy/utils": "^5.7.0",
"@uppy/xhr-upload": "^3.6.0",
"@uppy/xhr-upload": "3.6.0",
"@vitest/coverage-istanbul": "^4.0.17",
"@vitest/eslint-plugin": "1.6.6",
"@vitest/mocker": "^4.0.15",
@@ -306,7 +306,7 @@
"chart.js": "^4.0.1",
"chartjs-adapter-moment": "^1.0.1",
"chartjs-plugin-datalabels": "^2.2.0",
"cheerio": "^1.0.0-rc.3",
"cheerio": "1.0.0-rc.10",
"classnames": "^2.2.6",
"confusing-browser-globals": "^1.0.11",
"cookie-signature": "^1.2.1",
@@ -342,7 +342,7 @@
"handlebars": "^4.7.9",
"handlebars-loader": "^1.7.3",
"html-webpack-plugin": "^5.5.3",
"i18next-scanner": "^4.4.0",
"i18next-scanner": "4.4.0",
"idb": "^8.0.0",
"inversify": "^6.2.2",
"jquery": "^3.7.1",
@@ -395,7 +395,7 @@
"rehype-sanitize": "^6.0.0",
"resolve-url-loader": "^5.0.0",
"samlp": "^7.0.2",
"sandboxed-module": "overleaf/node-sandboxed-module#cafa2d60f17ce75cc023e6f296eb8de79d92d35d",
"sandboxed-module": "2.0.4",
"sass": "^1.77.1",
"sass-loader": "^14.2.1",
"scroll-into-view-if-needed": "^2.2.25",
@@ -409,7 +409,7 @@
"stylelint-config-standard-scss": "^13.1.0",
"tailwindcss": "^3.4.4",
"terser-webpack-plugin": "^5.3.17",
"thread-loader": "^4.0.2",
"thread-loader": "patch:thread-loader@npm%3A4.0.2#~/.yarn/patches/thread-loader-npm-4.0.2-dab5735f54.patch",
"timekeeper": "^2.2.0",
"to-string-loader": "^1.2.0",
"ts-loader": "^9.5.2",
+1 -1
View File
@@ -1,6 +1,6 @@
A nodejs tool for reading plans prices from csv files and creating JSON objects.
Run `npm install` in order to install the dependencies.
Run `yarn install` in order to install the dependencies.
The scripts will put the output results into the `output` folder.
+4 -1
View File
@@ -45,5 +45,8 @@
"cypress",
"types"
],
"exclude": ["**/*.min.js"]
"exclude": [
"**/*.min.js",
"modules/writefull/frontend/js/integration/src/vite-env.d.ts"
]
}
+13 -1
View File
@@ -217,7 +217,19 @@ module.exports = {
// Compiles Sass to CSS
{
loader: 'sass-loader',
options: { sourceMap: true }, // sourceMap: true is required for resolve-url-loader
options: {
api: 'modern',
sourceMap: true, // sourceMap: true is required for resolve-url-loader
sassOptions: {
silenceDeprecations: [
// TODO: import can't be fixed until we switch to bootstrap 6
'import',
'global-builtin',
'color-functions',
'if-function',
],
},
},
},
],
},