Skip to content

fix: remove unused dependencies

Pete Stenger requested to merge ps/1109-unused-dependencies into main

According to howfat, Kotahi has 470mb of dependencies, which can take quite a while to install. I remove all unused dependencies from the project in this request.

Useful commands:

View dependency costs

npx howfat -r tree

Check unused dependencies

npx depcheck

Remove dependencies - Note: a couple dependencies of the project are erroneously listed, and I did not remove those

npx depcheck --json | jq '.dependencies[]' | xargs -L1 npm rm

View sorted dependency costs

c = open('out2.txt','r').read().strip().split('\n')
rows = sorted(c, key=lambda l: eval(l.split(',')[1].replace('mb', '*1000').replace('kb', '*1')), reverse=True)
for l in rows:
  print(l)
npx howfat -r tree > out.txt && cat out.txt | grep '^(├─┬)' > out2.txt && python3 main.py && rm out.txt out2.txt
Edited by Pete Stenger

Merge request reports