Merge pull request #16390 from overleaf/jpa-aspell-0.60.8.1-1

[spelling] switch node base image and upgrade aspell

GitOrigin-RevId: 3d5a4d6f7b3e542b983f282bc00dab85e0979784
This commit is contained in:
Jakob Ackermann 2024-01-10 08:50:48 +00:00 committed by Copybot
parent 2bb8d7bab2
commit c62996a933
3 changed files with 78 additions and 8 deletions

View file

@ -2,7 +2,7 @@
# Instead run bin/update_build_scripts from
# https://github.com/overleaf/internal/
FROM node:18.18.2-buster as base
FROM node:18.18.2 as base
WORKDIR /overleaf/services/spelling
COPY services/spelling/install_deps.sh /overleaf/services/spelling/

View file

@ -3,7 +3,7 @@
set -ex
# Prefer Debian packages over Ubuntu packages
echo 'APT::Default-Release "buster";' >/etc/apt/apt.conf.d/default-release
echo 'APT::Default-Release "bookworm";' >/etc/apt/apt.conf.d/default-release
# The following aspell packages exist in Ubuntu but not Debian:
# aspell-af, aspell-id, aspell-nr, aspell-ns, aspell-st, aspell-tn, aspell-ts, aspell-xh
@ -11,11 +11,62 @@ echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ focal main universe" >
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ focal main universe" > /etc/apt/sources.list.d/focal-ports-arm.list
apt-key adv --no-tty --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
# aspell-pt-pt is broken in buster, we'll obtain it from bullseye
echo "deb http://deb.debian.org/debian bullseye main" > /etc/apt/sources.list.d/bullseye.list
# aspell is leaking memory in bookworm, we'll obtain it from trixie
echo "deb http://deb.debian.org/debian trixie main" > /etc/apt/sources.list.d/trixie.list
apt-get update
apt-get install -y aspell aspell-en aspell-af aspell-ar aspell-ar-large aspell-bg aspell-br aspell-ca aspell-cs aspell-cy aspell-da aspell-de aspell-de-1901 aspell-el aspell-eo aspell-es aspell-et aspell-eu-es aspell-fa aspell-fo aspell-fr aspell-ga aspell-gl-minimos aspell-hr aspell-hsb aspell-id aspell-it aspell-kk aspell-ku aspell-lt aspell-lv aspell-nl aspell-no aspell-nr aspell-ns aspell-pa aspell-pl aspell-pt-br aspell-ro aspell-ru aspell-sk aspell-sl aspell-st aspell-sv aspell-tl aspell-tn aspell-ts aspell-xh
# aspell-pt-pt is broken in buster. Install it from bullseye
apt-get install -y -t bullseye aspell-pt-pt
# aspell is leaking memory in bookworm, we'll obtain it from trixie
apt-get install -y -t trixie aspell=0.60.8.1-1
apt-get install -y \
aspell-af \
aspell-ar \
aspell-ar-large \
aspell-bg \
aspell-br \
aspell-ca \
aspell-cs \
aspell-cy \
aspell-da \
aspell-de \
aspell-de-1901 \
aspell-el \
aspell-en \
aspell-eo \
aspell-es \
aspell-et \
aspell-eu-es \
aspell-fa \
aspell-fo \
aspell-fr \
aspell-ga \
aspell-gl-minimos \
aspell-hr \
aspell-hsb \
aspell-id \
aspell-it \
aspell-kk \
aspell-ku \
aspell-lt \
aspell-lv \
aspell-nl \
aspell-no \
aspell-nr \
aspell-ns \
aspell-pa \
aspell-pl \
aspell-pt-br \
aspell-pt-pt \
aspell-ro \
aspell-ru \
aspell-sk \
aspell-sl \
aspell-st \
aspell-sv \
aspell-tl \
aspell-tn \
aspell-ts \
aspell-xh \
rm -rf /var/lib/apt/lists/*

View file

@ -27,7 +27,26 @@ describe('checking words', function () {
it('should return the list of misspellings', async function () {
const body = JSON.parse(response.body)
expect(body).to.deep.equal({
misspellings: [{ index: 0, suggestions: ['anther', 'another'] }],
misspellings: [
{
index: 0,
suggestions: [
'anther',
'another',
'anthers',
'panther',
'anathema',
'anthem',
'nether',
"anther's",
'ante',
'neither',
'norther',
'ether',
'other',
],
},
],
})
})
})