mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 06:03:34 +01:00
Refactor project structure and introduce workspaces (#6170)
* prototype for structure change - working
* move server.ts
* Revert "move server.ts"
This reverts commit 4cf2e61dc0
.
* adjusted package file
* further cleanup
* add workspace root flag
* fix docker install
* fix loadtest
* fix run
This commit is contained in:
parent
a8ff9d5667
commit
b4ac96d823
9 changed files with 48 additions and 13 deletions
4
.github/workflows/backend-tests.yml
vendored
4
.github/workflows/backend-tests.yml
vendored
|
@ -107,7 +107,7 @@ jobs:
|
|||
# The --legacy-peer-deps flag is required to work around a bug in npm v7:
|
||||
# https://github.com/npm/cli/issues/2199
|
||||
run: >
|
||||
pnpm install
|
||||
pnpm install --workspace-root
|
||||
ep_align
|
||||
ep_author_hover
|
||||
ep_cursortrace
|
||||
|
@ -223,7 +223,7 @@ jobs:
|
|||
# The --legacy-peer-deps flag is required to work around a bug in npm
|
||||
# v7: https://github.com/npm/cli/issues/2199
|
||||
run: >
|
||||
pnpm install
|
||||
pnpm install --workspace-root
|
||||
ep_align
|
||||
ep_author_hover
|
||||
ep_cursortrace
|
||||
|
|
2
.github/workflows/load-test.yml
vendored
2
.github/workflows/load-test.yml
vendored
|
@ -93,7 +93,7 @@ jobs:
|
|||
# The --legacy-peer-deps flag is required to work around a bug in npm v7:
|
||||
# https://github.com/npm/cli/issues/2199
|
||||
run: >
|
||||
pnpm install
|
||||
pnpm install --workspace-root
|
||||
ep_align
|
||||
ep_author_hover
|
||||
ep_cursortrace
|
||||
|
|
|
@ -88,15 +88,17 @@ COPY --chown=etherpad:etherpad ./.git/HEAD ./.git/HEAD
|
|||
COPY --chown=etherpad:etherpad ./.git/refs ./.git/refs
|
||||
COPY --chown=etherpad:etherpad ${SETTINGS} ./settings.json
|
||||
COPY --chown=etherpad:etherpad ./var ./var
|
||||
COPY --chown=etherpad:etherpad ./node_modules ./node_modules
|
||||
COPY --chown=etherpad:etherpad ./package.json ./package.json
|
||||
COPY --chown=etherpad:etherpad ./pnpm-workspace.yaml ./pnpm-workspace.yaml
|
||||
|
||||
FROM build as development
|
||||
|
||||
COPY --chown=etherpad:etherpad ./src/package.json .npmrc ./src/pnpm-lock.yaml ./src/
|
||||
|
||||
COPY --chown=etherpad:etherpad ./src/bin ./src/bin
|
||||
|
||||
RUN { [ -z "${ETHERPAD_PLUGINS}" ] || \
|
||||
pnpm install --no-save --legacy-peer-deps ${ETHERPAD_PLUGINS}; } && \
|
||||
pnpm install --workspace-root ${ETHERPAD_PLUGINS}; } && \
|
||||
src/bin/installDeps.sh
|
||||
|
||||
FROM build as production
|
||||
|
@ -118,7 +120,7 @@ COPY --chown=etherpad:etherpad ./src ./src
|
|||
# seems to confuse tools such as `npm outdated`, `npm update`, and some ESLint
|
||||
# rules.
|
||||
RUN { [ -z "${ETHERPAD_PLUGINS}" ] || \
|
||||
pnpm install --no-save --legacy-peer-deps ${ETHERPAD_PLUGINS}; } && \
|
||||
pnpm install --workspace-root ${ETHERPAD_PLUGINS}; } && \
|
||||
src/bin/installDeps.sh && \
|
||||
rm -rf ~/.npm
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ services:
|
|||
stdin_open: true
|
||||
volumes:
|
||||
- ./src:/opt/etherpad-lite/src
|
||||
- ./package.json:/opt/etherpad-lite/package.json
|
||||
- node_modules:/opt/etherpad-lite/src/node_modules
|
||||
- pnpm-store:/home/etherpad/.local/share/pnpm/store/v3
|
||||
depends_on:
|
||||
|
|
1
node_modules/ep_etherpad-lite
generated
vendored
1
node_modules/ep_etherpad-lite
generated
vendored
|
@ -1 +0,0 @@
|
|||
../src
|
38
package.json
Normal file
38
package.json
Normal file
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"name": "etherpad",
|
||||
"description": "A free and open source realtime collaborative editor",
|
||||
"homepage": "https://etherpad.org",
|
||||
"keywords": [
|
||||
"etherpad",
|
||||
"realtime",
|
||||
"collaborative",
|
||||
"editor"
|
||||
],
|
||||
"bin": {
|
||||
"etherpad-healthcheck": "src/bin/etherpad-healthcheck",
|
||||
"etherpad-lite": "src/bin/run"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "pnpm --filter ep_etherpad-lite run lint",
|
||||
"test": "pnpm --filter ep_etherpad-lite run test",
|
||||
"test-container": "pnpm --filter ep_etherpad-lite run test-container",
|
||||
"dev": "pnpm --filter ep_etherpad-lite run dev",
|
||||
"prod": "pnpm --filter ep_etherpad-lite run prod",
|
||||
"ts-check": "pnpm --filter ep_etherpad-lite run ts-check",
|
||||
"ts-check:watch": "pnpm --filter ep_etherpad-lite run ts-check:watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"ep_etherpad-lite": "workspace:./src"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.18.2",
|
||||
"npm": ">=6.14.0",
|
||||
"pnpm": ">=8.3.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ether/etherpad-lite.git"
|
||||
},
|
||||
"version": "1.9.7",
|
||||
"license": "Apache-2.0"
|
||||
}
|
0
pnpm-workspace.yaml
Normal file
0
pnpm-workspace.yaml
Normal file
|
@ -35,11 +35,6 @@ fi
|
|||
|
||||
|
||||
log "Installing dependencies..."
|
||||
(mkdir -p node_modules &&
|
||||
cd node_modules &&
|
||||
{ [ -d ep_etherpad-lite ] || ln -sf ../src ep_etherpad-lite; } &&
|
||||
cd ep_etherpad-lite)
|
||||
|
||||
cd src
|
||||
|
||||
if [ -z "${ETHERPAD_PRODUCTION}" ]; then
|
||||
|
|
|
@ -32,4 +32,4 @@ src/bin/installDeps.sh "$@" || exit 1
|
|||
# Move to the node folder and start
|
||||
log "Starting Etherpad..."
|
||||
|
||||
exec pnpm run dev --prefix ./src "$@"
|
||||
exec pnpm run dev "$@"
|
||||
|
|
Loading…
Reference in a new issue