Skip to content

versatiles-style

Version 2026.144.1443
Repo superproject

Local @versatiles/style MapLibre style-generator browser bundle for the Shortbread schema @versatiles/style is a TypeScript MapLibre style generator producing colorful() / eclipse() / graybeard() / neutrino() / shadow() / satellite() style JSON for maps backed by the Shortbread vector-tile schema. This candy installs nodejs + npm and lands the browser-ready bundle under /opt/versatiles-style/ (GitHub release tarball first, npm install fallback), so the notebook’s MapLibre HTML imports the styles from a local file instead of a runtime CDN dependency (unpkg.com). The bundle is re-served as static JS by the versatiles-frontend layer at /style/versatiles-style.js. The install is verifiable: a non-empty versatiles-style*.js must land under the install path, and the node toolchain that built and serves it must be present.

This candy’s plan: — the runnable spec charly check executes against a live deployment. check: steps are idempotent probes; run: steps change state.

Intent Step
run mkdir=/opt/versatiles-style
run command=set -euo pipefail TMPDIR=$(mktemp -d) cd “$TMPDIR” # Tier 1: GitHub release tarball. The release ships THREE # tarballs — versatiles-style.tar.gz, sprites.tar.gz, # styles.tar.gz. We need the versatiles-style.tar.gz one # specifically (the JS bundle), so anchor the regex to the # exact filename rather than a prefix match (which would # alphabetically pick sprites.tar.gz first). if curl -fsSL “https://api.github.com/repos/versatiles-org/versatiles-style/releases/latest” \ | jq -r ‘.assets[].browser_download_url’ \ | grep -E ‘/versatiles-style.tar.gz$’ \ | head -1 > tarball_url \ && [ -s tarball_url ]; then ASSET=$(cat tarball_url) echo “Installing versatiles-style from GitHub release: $ASSET” curl -fsSL “$ASSET” -o style.tar.gz tar -xzf style.tar.gz -C /opt/versatiles-style –strip-components=0 || \ tar -xzf style.tar.gz -C /opt/versatiles-style else # Tier 2: npm install echo “Falling back to npm install @versatiles/style” npm install –prefix “$TMPDIR” @versatiles/style –no-audit –no-fund # Look for the prebuilt browser bundle the package ships in # release/. If the package layout changed and release/ # doesn’t exist, copy the whole package so versatiles-style.js # is still findable via subsequent path-resolution. PKG=“$TMPDIR/node_modules/@versatiles/style” if [ -d “$PKG/release” ]; then cp -r “$PKG/release/.” /opt/versatiles-style/ else cp -r “$PKG/.” /opt/versatiles-style/ fi fi # Sanity: the bundle must end up findable. The check probe # below asserts this, but fail loudly here too so the build # log surfaces the issue. if ! find /opt/versatiles-style -maxdepth 3 -name ‘versatiles-style*.js’ -size +1c | head -1 | grep -q .; then echo “ERROR: no versatiles-style*.js found under /opt/versatiles-style after install” >&2 ls -la /opt/versatiles-style/ exit 1 fi cd / rm -rf “$TMPDIR” /root/.npm
check a non-empty versatiles-style*.js browser bundle is present under /opt/versatiles-style
check nodejs is installed so the @versatiles/style bundle can be built and served
check the node runtime reports its version
check file=/opt/versatiles-style