mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 14:43:46 +01:00
Acf pnp migration master (#34040)
GitOrigin-RevId: 418eab9bc733f27a6e0f8f04a2a8e21c2f5a491f
This commit is contained in:
committed by
Copybot
parent
d44e862a0c
commit
8f07308342
@@ -5,7 +5,6 @@
|
||||
FROM node:24.14.1 AS base
|
||||
|
||||
# Corepack setup, shared between all the images.
|
||||
ENV PATH="/overleaf/node_modules/.bin:$PATH"
|
||||
ENV COREPACK_HOME=/opt/corepack
|
||||
RUN corepack enable && corepack install -g yarn@4.14.1
|
||||
ENV COREPACK_ENABLE_NETWORK=0
|
||||
@@ -18,7 +17,7 @@ RUN mkdir /home/node/.config && chown node:node /home/node/.config
|
||||
|
||||
FROM base AS app
|
||||
|
||||
COPY package.json yarn.lock .yarnrc.yml /overleaf/
|
||||
COPY package.json yarn.lock .yarnrc.yml .pnp.register.mjs /overleaf/
|
||||
COPY libraries/eslint-plugin/package.json /overleaf/libraries/eslint-plugin/package.json
|
||||
COPY libraries/fetch-utils/package.json /overleaf/libraries/fetch-utils/package.json
|
||||
COPY libraries/logger/package.json /overleaf/libraries/logger/package.json
|
||||
@@ -44,6 +43,8 @@ COPY libraries/settings/ /overleaf/libraries/settings/
|
||||
COPY services/chat/ /overleaf/services/chat/
|
||||
COPY tools/migrations/ /overleaf/tools/migrations/
|
||||
|
||||
ENV NODE_OPTIONS="--require /overleaf/.pnp.cjs --import /overleaf/.pnp.register.mjs"
|
||||
|
||||
FROM app
|
||||
USER node
|
||||
|
||||
|
||||
@@ -69,9 +69,11 @@ clean:
|
||||
# Eslint and prettier (plus some configs) are on the root.
|
||||
RUN_LINTING = ../../bin/run -w /overleaf/services/$(PROJECT_NAME) monorepo yarn run --silent
|
||||
RUN_LINTING_MONOREPO = ../../bin/run monorepo yarn run --silent
|
||||
RUN_EXEC_MONOREPO = ../../bin/run monorepo yarn exec
|
||||
|
||||
RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/eslint.config.mjs:/overleaf/eslint.config.mjs --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc.cjs:/overleaf/.prettierrc.cjs --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/chat/reports:/overleaf/services/chat/reports --volume $(MONOREPO)/.cache:/overleaf/.cache $(IMAGE_CI) yarn run --silent
|
||||
RUN_LINTING_CI_MONOREPO = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/eslint.config.mjs:/overleaf/eslint.config.mjs --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc.cjs:/overleaf/.prettierrc.cjs --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/chat/reports:/overleaf/services/chat/reports --volume $(MONOREPO)/.cache:/overleaf/.cache -w /overleaf $(IMAGE_CI) yarn run --silent
|
||||
RUN_EXEC_CI_MONOREPO = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/eslint.config.mjs:/overleaf/eslint.config.mjs --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc.cjs:/overleaf/.prettierrc.cjs --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/chat/reports:/overleaf/services/chat/reports --volume $(MONOREPO)/.cache:/overleaf/.cache -w /overleaf $(IMAGE_CI) yarn exec
|
||||
|
||||
SHELLCHECK_OPTS = \
|
||||
--shell=bash \
|
||||
@@ -119,14 +121,14 @@ format_fix:
|
||||
$(RUN_LINTING_MONOREPO) format:fix services/chat
|
||||
|
||||
lint:
|
||||
$(RUN_LINTING) lint
|
||||
$(RUN_EXEC_MONOREPO) eslint --cache --cache-location ./.cache/eslint/ --max-warnings 0 --format unix services/chat
|
||||
|
||||
lint_ci:
|
||||
-$(RUN_LINTING_CI) lint --format json --output-file reports/eslint.json
|
||||
-$(RUN_EXEC_CI_MONOREPO) eslint --cache --cache-location ./.cache/eslint/ --max-warnings 0 --format json --output-file services/chat/reports/eslint.json services/chat
|
||||
sed -i 's_"filePath":"/overleaf_"filePath":"$(MONOREPO)_g' reports/eslint.json
|
||||
|
||||
lint_fix:
|
||||
$(RUN_LINTING) lint:fix
|
||||
$(RUN_EXEC_MONOREPO) eslint --cache --cache-location ./.cache/eslint/ --fix services/chat
|
||||
|
||||
typecheck:
|
||||
$(RUN_LINTING) types:check
|
||||
|
||||
@@ -10,12 +10,14 @@ services:
|
||||
target: base
|
||||
volumes:
|
||||
- .:/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
|
||||
- ../../.yarn:/overleaf/.yarn
|
||||
- ../../.pnp.cjs:/overleaf/.pnp.cjs
|
||||
- ../../.pnp.loader.mjs:/overleaf/.pnp.loader.mjs
|
||||
- ../../.pnp.register.mjs:/overleaf/.pnp.register.mjs
|
||||
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
|
||||
- ../../tools/migrations:/overleaf/tools/migrations
|
||||
working_dir: /overleaf/services/chat
|
||||
@@ -24,7 +26,7 @@ services:
|
||||
LOG_LEVEL: ${LOG_LEVEL:-}
|
||||
MONGO_CONNECTION_STRING: mongodb://mongo/test-overleaf
|
||||
NODE_ENV: test
|
||||
NODE_OPTIONS: "--unhandled-rejections=strict"
|
||||
NODE_OPTIONS: "--require /overleaf/.pnp.cjs --import /overleaf/.pnp.register.mjs --unhandled-rejections=strict"
|
||||
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
|
||||
command: yarn run --silent test:unit
|
||||
user: node
|
||||
@@ -39,12 +41,14 @@ services:
|
||||
target: base
|
||||
volumes:
|
||||
- .:/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
|
||||
- ../../.yarn:/overleaf/.yarn
|
||||
- ../../.pnp.cjs:/overleaf/.pnp.cjs
|
||||
- ../../.pnp.loader.mjs:/overleaf/.pnp.loader.mjs
|
||||
- ../../.pnp.register.mjs:/overleaf/.pnp.register.mjs
|
||||
- ../../bin/shared/wait_for_it:/overleaf/bin/shared/wait_for_it
|
||||
- ../../tools/migrations:/overleaf/tools/migrations
|
||||
working_dir: /overleaf/services/chat
|
||||
@@ -55,7 +59,7 @@ services:
|
||||
MOCHA_GREP: ${MOCHA_GREP}
|
||||
LOG_LEVEL: ${LOG_LEVEL:-}
|
||||
NODE_ENV: test
|
||||
NODE_OPTIONS: "--unhandled-rejections=strict"
|
||||
NODE_OPTIONS: "--require /overleaf/.pnp.cjs --import /overleaf/.pnp.register.mjs --unhandled-rejections=strict"
|
||||
user: node
|
||||
depends_on:
|
||||
mongo:
|
||||
|
||||
@@ -29,10 +29,12 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@overleaf/migrations": "workspace:*",
|
||||
"@types/node": "^24.5.2",
|
||||
"acorn": "^7.1.1",
|
||||
"ajv": "^6.12.0",
|
||||
"chai": "^4.3.6",
|
||||
"chai-as-promised": "^7.1.1",
|
||||
"eslint": "^10.4.0",
|
||||
"mocha": "^11.1.0",
|
||||
"mocha-junit-reporter": "^2.2.1",
|
||||
"mocha-multi-reporters": "^1.5.1",
|
||||
|
||||
@@ -5,6 +5,6 @@ before('run migrations', async function () {
|
||||
this.timeout(60_000)
|
||||
|
||||
await promisify(exec)(
|
||||
`cd ../../tools/migrations && npm run migrations -- migrate -t server-ce`
|
||||
`cd ../../tools/migrations && yarn run migrations migrate -t server-ce`
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user