bundle.bash 819 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. set -e
  3. # Run this script from the root of the repository
  4. curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
  5. # This loads nvm
  6. export NVM_DIR="$HOME/.nvm"
  7. [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
  8. # Select a version
  9. nvm install 20
  10. # print versions
  11. node -v
  12. npm -v
  13. # The CodeMirror packages used in our script
  14. npm i codemirror @codemirror/language-data
  15. # Themes
  16. npm i @uiw/codemirror-themes-all @codemirror/theme-one-dark @babel/runtime
  17. # Install Rollup and its plugin
  18. npm i rollup @rollup/plugin-node-resolve @rollup/plugin-terser
  19. # Clear target dir
  20. rm -rf ../../nicegui/elements/lib/codemirror/*
  21. # Bundle with rollup
  22. npx rollup -c rollup.config.mjs --validate
  23. # Print the installed version
  24. echo "Installed CodeMirror version:"
  25. npm list codemirror