diff --git a/README.md b/README.md index 3de320e5..9224d1be 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![Join the chat at https://gitter.im/KaTeX/KaTeX](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/KaTeX/KaTeX?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=KaTeX/KaTeX)](https://dependabot.com) [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/katex/badge?style=rounded)](https://www.jsdelivr.com/package/npm/katex) -![](https://img.badgesize.io/KaTeX/KaTeX/v0.12.0/dist/katex.min.js?compression=gzip) +![katex.min.js size](https://img.badgesize.io/https://unpkg.com/katex/dist/katex.min.js?compression=gzip) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/KaTeX/KaTeX) KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web. diff --git a/release.sh b/release.sh index ff74d2ef..0cfb51eb 100755 --- a/release.sh +++ b/release.sh @@ -181,27 +181,20 @@ if [[ ! $PUBLISH ]]; then echo "After it gets merged, run './release.sh -p $VERSION'!" echo "Note that if KaTeX source code is changed after running this script," echo "you have to run the release script again." -else - # Make a new detached HEAD - git checkout --detach + git diff --stat --exit-code # check for uncommitted changes +else # Edit package.json to the right version sed -i.bak -E 's|"version": "[^"]+",|"version": "'$VERSION'",|' package.json rm -f package.json.bak - # Build generated files and add them to the repository - git clean -fdx dist + # Build generated files yarn dist - sed -i.bak -E '/^\/dist\/$/d' .gitignore - rm -f .gitignore.bak # Check Subresource Integrity hashes yarn node update-sri.js check README.md contrib/*/README.md - # Make the commit and tag, and push them. - git add package.json .gitignore dist/ - git commit -n -m "v$VERSION" - git diff --stat --exit-code # check for uncommitted changes + # Make the tag and push git tag -a "v$VERSION" -m "v$VERSION" git push "$ORIGIN" "v$VERSION" @@ -216,8 +209,6 @@ else echo "Don't forget to upload katex.tar.gz and katex.zip to the release!" fi -git diff --stat --exit-code # check for uncommitted changes - if [[ $DRY_RUN ]]; then echo "" echo "This was a dry run." diff --git a/update-sri.js b/update-sri.js index 452ca850..ca0a2279 100644 --- a/update-sri.js +++ b/update-sri.js @@ -9,10 +9,6 @@ const version = process.argv[2]; Promise.all(process.argv.slice(3).map(file => fs.readFile(file, "utf8") .then(body => { - // Replace size badge url - // eslint-disable-next-line max-len - body = body.replace(/(https:\/\/img\.badgesize\.io\/KaTeX\/KaTeX\/v)(?:.+)(\/dist\/katex\.min\.js\?compression=gzip)/g, `$1${version}$2`); - // Replace CDN urls // 1 - url prefix: "http…/KaTeX/ // 2 - opening quote: "