mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 17:06:16 -04:00
Added initial bun support.
This commit is contained in:
parent
b6ce8c7377
commit
8be2dffc37
9 changed files with 32 additions and 9619 deletions
70
.github/workflows/backend-tests.yml
vendored
70
.github/workflows/backend-tests.yml
vendored
|
@ -18,19 +18,15 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
node: [16, 18, 20]
|
node: [1.0.3, canary]
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout repository
|
name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
uses: actions/setup-node@v3
|
uses: oven-sh/setup-bun@v1
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node }}
|
bun-version: ${{ matrix.node }}
|
||||||
cache: 'npm'
|
|
||||||
cache-dependency-path: |
|
|
||||||
src/package-lock.json
|
|
||||||
src/bin/doc/package-lock.json
|
|
||||||
-
|
-
|
||||||
name: Install libreoffice
|
name: Install libreoffice
|
||||||
run: |
|
run: |
|
||||||
|
@ -42,7 +38,7 @@ jobs:
|
||||||
run: src/bin/installDeps.sh
|
run: src/bin/installDeps.sh
|
||||||
-
|
-
|
||||||
name: Run the backend tests
|
name: Run the backend tests
|
||||||
run: cd src && npm test
|
run: cd src && bun test
|
||||||
|
|
||||||
withpluginsLinux:
|
withpluginsLinux:
|
||||||
# run on pushes to any branch
|
# run on pushes to any branch
|
||||||
|
@ -55,19 +51,15 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
node: [16, 18, 20]
|
node: [1.0.3, canary]
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout repository
|
name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
uses: actions/setup-node@v3
|
uses: oven-sh/setup-bun@v1
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node }}
|
bun-version: ${{ matrix.node }}
|
||||||
cache: 'npm'
|
|
||||||
cache-dependency-path: |
|
|
||||||
src/package-lock.json
|
|
||||||
src/bin/doc/package-lock.json
|
|
||||||
-
|
-
|
||||||
name: Install libreoffice
|
name: Install libreoffice
|
||||||
run: |
|
run: |
|
||||||
|
@ -76,10 +68,8 @@ jobs:
|
||||||
sudo apt install -y --no-install-recommends libreoffice libreoffice-pdfimport
|
sudo apt install -y --no-install-recommends libreoffice libreoffice-pdfimport
|
||||||
-
|
-
|
||||||
name: Install Etherpad plugins
|
name: Install Etherpad plugins
|
||||||
# The --legacy-peer-deps flag is required to work around a bug in npm v7:
|
|
||||||
# https://github.com/npm/cli/issues/2199
|
|
||||||
run: >
|
run: >
|
||||||
npm install --no-save --legacy-peer-deps
|
bun install --no-save --legacy-peer-deps
|
||||||
ep_align
|
ep_align
|
||||||
ep_author_hover
|
ep_author_hover
|
||||||
ep_cursortrace
|
ep_cursortrace
|
||||||
|
@ -93,21 +83,12 @@ jobs:
|
||||||
ep_spellcheck
|
ep_spellcheck
|
||||||
ep_subscript_and_superscript
|
ep_subscript_and_superscript
|
||||||
ep_table_of_contents
|
ep_table_of_contents
|
||||||
# Etherpad core dependencies must be installed after installing the
|
|
||||||
# plugin's dependencies, otherwise npm will try to hoist common
|
|
||||||
# dependencies by removing them from src/node_modules and installing them
|
|
||||||
# in the top-level node_modules. As of v6.14.10, npm's hoist logic appears
|
|
||||||
# to be buggy, because it sometimes removes dependencies from
|
|
||||||
# src/node_modules but fails to add them to the top-level node_modules.
|
|
||||||
# Even if npm correctly hoists the dependencies, the hoisting seems to
|
|
||||||
# confuse tools such as `npm outdated`, `npm update`, and some ESLint
|
|
||||||
# rules.
|
|
||||||
-
|
-
|
||||||
name: Install all dependencies and symlink for ep_etherpad-lite
|
name: Install all dependencies and symlink for ep_etherpad-lite
|
||||||
run: src/bin/installDeps.sh
|
run: src/bin/installDeps.sh
|
||||||
-
|
-
|
||||||
name: Run the backend tests
|
name: Run the backend tests
|
||||||
run: cd src && npm test
|
run: cd src && bun run test
|
||||||
|
|
||||||
withoutpluginsWindows:
|
withoutpluginsWindows:
|
||||||
# run on pushes to any branch
|
# run on pushes to any branch
|
||||||
|
@ -122,13 +103,9 @@ jobs:
|
||||||
name: Checkout repository
|
name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
uses: actions/setup-node@v3
|
uses: oven-sh/setup-bun@v1
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
bun-version: latest
|
||||||
cache: 'npm'
|
|
||||||
cache-dependency-path: |
|
|
||||||
src/package-lock.json
|
|
||||||
src/bin/doc/package-lock.json
|
|
||||||
-
|
-
|
||||||
name: Install all dependencies and symlink for ep_etherpad-lite
|
name: Install all dependencies and symlink for ep_etherpad-lite
|
||||||
run: src/bin/installOnWindows.bat
|
run: src/bin/installOnWindows.bat
|
||||||
|
@ -139,7 +116,7 @@ jobs:
|
||||||
powershell -Command "(gc settings.json.holder) -replace '\"points\": 10', '\"points\": 1000' | Out-File -encoding ASCII settings.json"
|
powershell -Command "(gc settings.json.holder) -replace '\"points\": 10', '\"points\": 1000' | Out-File -encoding ASCII settings.json"
|
||||||
-
|
-
|
||||||
name: Run the backend tests
|
name: Run the backend tests
|
||||||
run: cd src && npm test
|
run: cd src && bun run test
|
||||||
|
|
||||||
withpluginsWindows:
|
withpluginsWindows:
|
||||||
# run on pushes to any branch
|
# run on pushes to any branch
|
||||||
|
@ -155,19 +132,13 @@ jobs:
|
||||||
name: Checkout repository
|
name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
uses: actions/setup-node@v3
|
uses: oven-sh/setup-bun@v1
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
bun-version: latest
|
||||||
cache: 'npm'
|
|
||||||
cache-dependency-path: |
|
|
||||||
src/package-lock.json
|
|
||||||
src/bin/doc/package-lock.json
|
|
||||||
-
|
-
|
||||||
name: Install Etherpad plugins
|
name: Install Etherpad plugins
|
||||||
# The --legacy-peer-deps flag is required to work around a bug in npm
|
|
||||||
# v7: https://github.com/npm/cli/issues/2199
|
|
||||||
run: >
|
run: >
|
||||||
npm install --no-save --legacy-peer-deps
|
bun install --no-save
|
||||||
ep_align
|
ep_align
|
||||||
ep_author_hover
|
ep_author_hover
|
||||||
ep_cursortrace
|
ep_cursortrace
|
||||||
|
@ -181,15 +152,6 @@ jobs:
|
||||||
ep_spellcheck
|
ep_spellcheck
|
||||||
ep_subscript_and_superscript
|
ep_subscript_and_superscript
|
||||||
ep_table_of_contents
|
ep_table_of_contents
|
||||||
# Etherpad core dependencies must be installed after installing the
|
|
||||||
# plugin's dependencies, otherwise npm will try to hoist common
|
|
||||||
# dependencies by removing them from src/node_modules and installing them
|
|
||||||
# in the top-level node_modules. As of v6.14.10, npm's hoist logic appears
|
|
||||||
# to be buggy, because it sometimes removes dependencies from
|
|
||||||
# src/node_modules but fails to add them to the top-level node_modules.
|
|
||||||
# Even if npm correctly hoists the dependencies, the hoisting seems to
|
|
||||||
# confuse tools such as `npm outdated`, `npm update`, and some ESLint
|
|
||||||
# rules.
|
|
||||||
-
|
-
|
||||||
name: Install all dependencies and symlink for ep_etherpad-lite
|
name: Install all dependencies and symlink for ep_etherpad-lite
|
||||||
run: src/bin/installOnWindows.bat
|
run: src/bin/installOnWindows.bat
|
||||||
|
@ -200,4 +162,4 @@ jobs:
|
||||||
powershell -Command "(gc settings.json.holder) -replace '\"points\": 10', '\"points\": 1000' | Out-File -encoding ASCII settings.json"
|
powershell -Command "(gc settings.json.holder) -replace '\"points\": 10', '\"points\": 1000' | Out-File -encoding ASCII settings.json"
|
||||||
-
|
-
|
||||||
name: Run the backend tests
|
name: Run the backend tests
|
||||||
run: cd src && npm test
|
run: cd src && bun run test
|
||||||
|
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -21,3 +21,5 @@ out/
|
||||||
/src/bin/convertSettings.json
|
/src/bin/convertSettings.json
|
||||||
/src/bin/etherpad-1.deb
|
/src/bin/etherpad-1.deb
|
||||||
/src/bin/node.exe
|
/src/bin/node.exe
|
||||||
|
|
||||||
|
*.lockb binary diff=lockb
|
|
@ -8,20 +8,17 @@ cd "${MY_DIR}/../.." || exit 1
|
||||||
# Source constants and useful functions
|
# Source constants and useful functions
|
||||||
. src/bin/functions.sh
|
. src/bin/functions.sh
|
||||||
|
|
||||||
# Is node installed?
|
# Is bun installed?
|
||||||
# Not checking io.js, default installation creates a symbolic link to node
|
is_cmd bun || fatal "Please install bun ( https://bun.sh )"
|
||||||
is_cmd node || fatal "Please install node.js ( https://nodejs.org )"
|
|
||||||
|
|
||||||
# Is npm installed?
|
|
||||||
is_cmd npm || fatal "Please install npm ( https://npmjs.org )"
|
|
||||||
|
|
||||||
# Check npm version
|
# Check npm version
|
||||||
require_minimal_version "npm" "$(get_program_version "npm")" \
|
#require_minimal_version "npm" "$(get_program_version "npm")" \
|
||||||
"$REQUIRED_NPM_MAJOR" "$REQUIRED_NPM_MINOR"
|
# "$REQUIRED_NPM_MAJOR" "$REQUIRED_NPM_MINOR"
|
||||||
|
|
||||||
# Check node version
|
# Check node version
|
||||||
require_minimal_version "nodejs" "$(get_program_version "node")" \
|
#require_minimal_version "nodejs" "$(get_program_version "node")" \
|
||||||
"$REQUIRED_NODE_MAJOR" "$REQUIRED_NODE_MINOR"
|
# "$REQUIRED_NODE_MAJOR" "$REQUIRED_NODE_MINOR"
|
||||||
|
|
||||||
# Get the name of the settings file
|
# Get the name of the settings file
|
||||||
settings="settings.json"
|
settings="settings.json"
|
||||||
|
@ -48,10 +45,10 @@ cd src
|
||||||
|
|
||||||
if [ -z "${ETHERPAD_PRODUCTION}" ]; then
|
if [ -z "${ETHERPAD_PRODUCTION}" ]; then
|
||||||
log "Installing dev dependencies"
|
log "Installing dev dependencies"
|
||||||
npm ci --no-optional --omit=optional --include=dev --lockfile-version 1 || exit 1
|
bun install --no-optional --omit=optional --include=dev --lockfile-version 1 || exit 1
|
||||||
else
|
else
|
||||||
log "Installing production dependencies"
|
log "Installing production dependencies"
|
||||||
npm ci --no-optional --omit=optional --omit=dev --lockfile-version 1 --production || exit 1
|
bun install --no-optional --omit=optional --omit=dev --lockfile-version 1 --production || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove all minified data to force node creating it new
|
# Remove all minified data to force node creating it new
|
||||||
|
|
|
@ -14,7 +14,7 @@ cd /D node_modules
|
||||||
mklink /D "ep_etherpad-lite" "..\src"
|
mklink /D "ep_etherpad-lite" "..\src"
|
||||||
|
|
||||||
cd /D "ep_etherpad-lite"
|
cd /D "ep_etherpad-lite"
|
||||||
cmd /C npm ci || exit /B 1
|
cmd /C bun install --frozen-lockfile || exit /B 1
|
||||||
|
|
||||||
cd /D "%~dp0\..\.."
|
cd /D "%~dp0\..\.."
|
||||||
|
|
||||||
|
|
|
@ -32,4 +32,4 @@ src/bin/installDeps.sh "$@" || exit 1
|
||||||
# Move to the node folder and start
|
# Move to the node folder and start
|
||||||
log "Starting Etherpad..."
|
log "Starting Etherpad..."
|
||||||
|
|
||||||
exec node src/node/server.js "$@"
|
exec bun run src/node/server.js "$@"
|
||||||
|
|
BIN
src/bun.lockb
Executable file
BIN
src/bun.lockb
Executable file
Binary file not shown.
9549
src/package-lock.json
generated
9549
src/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -93,6 +93,7 @@
|
||||||
"typescript": "^4.9.5"
|
"typescript": "^4.9.5"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
"bun": ">=1.0.3",
|
||||||
"node": ">=16.20.1",
|
"node": ">=16.20.1",
|
||||||
"npm": ">=6.14.0"
|
"npm": ">=6.14.0"
|
||||||
},
|
},
|
||||||
|
|
|
@ -14,10 +14,10 @@ const logger = log4js.getLogger('plugins');
|
||||||
// Log the version of npm at startup.
|
// Log the version of npm at startup.
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
const version = await runCmd(['npm', '--version'], {stdio: [null, 'string']});
|
const version = await runCmd(['bun', '--version'], {stdio: [null, 'string']});
|
||||||
logger.info(`npm --version: ${version}`);
|
logger.info(`bun --version: ${version}`);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.error(`Failed to get npm version: ${err.stack || err}`);
|
logger.error(`Failed to get bun version: ${err.stack || err}`);
|
||||||
// This isn't a fatal error so don't re-throw.
|
// This isn't a fatal error so don't re-throw.
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue