diff --git a/Dockerfile b/Dockerfile index a50d6bca5..ba4610d51 100644 --- a/Dockerfile +++ b/Dockerfile @@ -88,11 +88,11 @@ 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 FROM build as development COPY --chown=etherpad:etherpad ./src/package.json .npmrc ./src/pnpm-lock.yaml ./src/ +COPY --chown=etherpad:etherpad ./package.json ./package.json COPY --chown=etherpad:etherpad ./src/bin ./src/bin RUN { [ -z "${ETHERPAD_PLUGINS}" ] || \ diff --git a/docker-compose.yml b/docker-compose.yml index bb4ac85ee..189c23f91 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: diff --git a/node_modules/ep_etherpad-lite b/node_modules/ep_etherpad-lite deleted file mode 120000 index 5cd551cf2..000000000 --- a/node_modules/ep_etherpad-lite +++ /dev/null @@ -1 +0,0 @@ -../src \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 000000000..0c2cbc627 --- /dev/null +++ b/package.json @@ -0,0 +1,60 @@ +{ + "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/node/server.ts" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --import=tsx --timeout 120000 --recursive src/tests/backend/specs src/node_modules/ep_*/static/tests/backend/specs", + "test-container": "mocha --import=tsx --timeout 5000 src/tests/container/specs/api", + "dev": "node --import tsx src/node/server.ts", + "prod": "node --import tsx src/node/server.ts", + "ts-check": "tsc --noEmit", + "ts-check:watch": "tsc --noEmit --watch" + }, + "dependencies": { + "log4js": "^6.9.1", + "tsx": "^4.7.1", + "underscore": "1.13.6", + "fast-deep-equal": "^3.1.3", + "cookie-parser": "^1.4.6", + "jsonminify": "0.4.2", + "express-rate-limit": "^7.1.5", + "express-session": "npm:@etherpad/express-session@^1.18.2", + "express": "4.18.2", + "find-root": "1.1.0", + "semver": "^7.6.0", + "live-plugin-manager-pnpm": "^0.18.1", + "cross-spawn": "^7.0.3", + "ueberdb2": "^4.2.56", + "measured-core": "^2.0.0", + "axios": "^1.6.7", + "wtfnode": "^0.9.1", + "ep_etherpad-lite": "workspace:./src" + }, + "devDependencies": { + "@types/express": "^4.17.21", + "@types/node": "^20.11.19", + "typescript": "^5.3.3" + }, + "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" +} \ No newline at end of file diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/src/bin/installDeps.sh b/src/bin/installDeps.sh index dde000b7c..722dec0d0 100755 --- a/src/bin/installDeps.sh +++ b/src/bin/installDeps.sh @@ -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 diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 000000000..eea5f16fa --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + "moduleDetection": "force", + "lib": ["es6"], + /* Language and Environment */ + "target": "es6", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + /* Completeness */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + } +}