mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-16 03:40:37 +08:00
Cache npm dependencies in Buildkite
- Add twemoji as npm dependency instead of build download - Package build assets with a Vite plugin instead of scripts - Keep the eslint and prettier caches in one directory
This commit is contained in:
+7
-2
@@ -3,5 +3,10 @@ set -e
|
||||
|
||||
npx tsc --noEmit
|
||||
npx svelte-check --tsconfig tsconfig.json --config ./vite.config.ts --fail-on-warnings --compiler-warnings options_missing_custom_element:ignore
|
||||
npx eslint --cache --cache-location node_modules/.cache/eslint --max-warnings 0 .
|
||||
npx prettier "**/*.@(ts|js|svelte|json|css|html|yml)" --ignore-path .gitignore --ignore-path .prettierignore --check --cache
|
||||
# Both caches sit outside node_modules, which `npm ci` deletes, and both are
|
||||
# keyed on file contents rather than mtimes, which a fresh checkout changes.
|
||||
# CI can then carry them between builds. They share one directory because a
|
||||
# Buildkite cache path is always a directory, never a file.
|
||||
mkdir -p .lintcache
|
||||
npx eslint --cache --cache-location .lintcache/eslint --cache-strategy content --max-warnings 0 .
|
||||
npx prettier "**/*.@(ts|js|svelte|json|css|html|yml)" --ignore-path .gitignore --ignore-path .prettierignore --check --cache --cache-location .lintcache/prettier
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -Eeuo pipefail
|
||||
|
||||
echo "Copying katex assets into bundle directory"
|
||||
|
||||
cp -r node_modules/katex/dist/katex.min.css public/katex.min.css
|
||||
cp -r node_modules/katex/dist/fonts/* public/fonts/
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -Eeou pipefail
|
||||
|
||||
version="$(node -e 'console.log(require("twemoji/package.json").version)')"
|
||||
|
||||
echo "Installing Twemoji SVG assets v${version}"
|
||||
|
||||
curl -sSL "https://github.com/twitter/twemoji/archive/refs/tags/v${version}.tar.gz" \
|
||||
| tar -x -z -C public/twemoji/ --strip-components=3 "twemoji-${version}/assets/svg"
|
||||
Reference in New Issue
Block a user