mdedit/ is gone. Its functionality moved into browse's preview plugin
(browse/js/preview-markdown.js) — YAML front matter editing, outline,
and on-demand DOCX/HTML/PDF download all happen there. Browse is the
default_tool for working/ + reviewing/ as of the previous commit, so
existing URLs of the form /<project>/working land on browse without
operator action.
Removed:
• mdedit/ source tree (Toast UI app, CSS, JS, template, build.sh)
• zddc/internal/apps/embedded/mdedit.html (//go:embed blob)
• tests/mdedit.spec.js + the "mdedit" project in playwright.config.js
• mdedit entries in zddc/internal/apps/embed.go (//go:embed, var,
switch case in EmbeddedBytes)
• "mdedit" in zddc/internal/zddc/validate.go AppNames + the matching
error-message app list
• "mdedit.html" branch in zddc/internal/apps/handler.go MatchAppHTML
• mdedit case in tests (handler_test.go, validate_test.go,
zddchandler_test.go) — test fixtures now use browse/classifier
• mdedit from build (per-tool build.sh loop, tool-list literals,
composer cards) and shared/build-lib.sh ZDDC_RELEASE_TOOLS
• mdedit from freshen-channel's tool list and usage banner
• mdedit-specific paragraphs in AGENTS.md and ARCHITECTURE.md;
Markdown Editor section in ARCHITECTURE.md rewritten to point at
browse/js/preview-markdown.js
• mdedit from CLAUDE.md, README.md, zddc/README.md tool lists
Historical mdedit_v*.html / mdedit_v*.html.sig files in
/srv/zddc/releases/ on the deploy host are immutable history — they
stay where they are. The next ./build release cut will simply not
produce new mdedit_v* artifacts.
99 lines
3.6 KiB
Bash
Executable file
99 lines
3.6 KiB
Bash
Executable file
#!/bin/sh
|
|
# =============================================================================
|
|
# freshen-channel — rebuild a tool's alpha or beta channel from its current
|
|
# stable tag, so users tracking that channel are never on code older than
|
|
# current stable.
|
|
#
|
|
# Usage:
|
|
# ./freshen-channel <tool> <channel>
|
|
# tool archive | transmittal | classifier | browse | landing | form | tables
|
|
# channel alpha | beta
|
|
#
|
|
# Why this exists:
|
|
# Stable releases do NOT automatically clobber alpha/beta files (see
|
|
# AGENTS.md "Channel discipline" rule 4). After cutting stable v0.0.5,
|
|
# users pinned to alpha may be on an older build than current stable —
|
|
# that violates the stale-channel rule. Run this to drag alpha (or
|
|
# beta) forward to whatever stable currently is.
|
|
#
|
|
# What it does:
|
|
# 1. Finds the latest <tool>-v* tag.
|
|
# 2. Creates a temporary git worktree at that tag — does NOT touch
|
|
# your current branch or working tree.
|
|
# 3. Runs <tool>/build.sh --release <channel> inside the worktree.
|
|
# 4. Copies the resulting <tool>_<channel>.html into the main repo's
|
|
# website/releases/.
|
|
# 5. Removes the worktree.
|
|
#
|
|
# The on-page label of the freshened build will be
|
|
# `<channel> · <today> · <stable-tag-sha>` — the SHA encodes which
|
|
# stable was used as the source, so anyone debugging can `git checkout`
|
|
# that exact commit.
|
|
#
|
|
# Note: the build pipeline used is the one AT THE TAG, not the latest
|
|
# main. That is intentional — pure reproducibility. If you have made
|
|
# build-system improvements since stable was cut and want the freshen
|
|
# to use them, cut a new stable that includes those changes first.
|
|
# =============================================================================
|
|
set -eu
|
|
|
|
TOOL="${1:-}"
|
|
CHANNEL="${2:-}"
|
|
|
|
case "$TOOL" in
|
|
archive | transmittal | classifier | browse | landing | form | tables) ;;
|
|
*)
|
|
echo "usage: $0 <tool> <channel>" >&2
|
|
echo " tool: archive | transmittal | classifier | browse | landing | form | tables" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
case "$CHANNEL" in
|
|
alpha | beta) ;;
|
|
*)
|
|
echo "usage: $0 <tool> <channel>" >&2
|
|
echo " channel: alpha | beta (stable is what you are freshening FROM)" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
REPO=$(cd "$(dirname "$0")" && pwd)
|
|
|
|
# Find the latest stable tag for the tool.
|
|
LATEST_TAG=$(git -C "$REPO" tag --list "${TOOL}-v*" --sort=-v:refname | head -1)
|
|
if [ -z "$LATEST_TAG" ]; then
|
|
echo "error: no stable tag found for ${TOOL} (looking for ${TOOL}-v*)" >&2
|
|
echo " cut a stable release first: sh ${TOOL}/build.sh --release [version]" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Temporary detached worktree at the stable tag. Cleaned up on exit.
|
|
WT=$(mktemp -d)
|
|
cleanup() {
|
|
git -C "$REPO" worktree remove --force "$WT" >/dev/null 2>&1 || true
|
|
rm -rf "$WT"
|
|
}
|
|
trap cleanup EXIT INT TERM
|
|
|
|
echo "Freshening ${TOOL} ${CHANNEL} from ${LATEST_TAG}"
|
|
git -C "$REPO" worktree add --quiet --detach "$WT" "$LATEST_TAG"
|
|
|
|
# Build in the worktree. The tool's build.sh resolves its release dir
|
|
# from $ZDDC_DEPLOY_RELEASES_DIR (default $REPO/dist/release-output);
|
|
# pass through whatever the parent process has set so freshen-channel
|
|
# honors the same target as the regular build.
|
|
DEPLOY_DIR="${ZDDC_DEPLOY_RELEASES_DIR:-$REPO/dist/release-output}"
|
|
mkdir -p "$DEPLOY_DIR"
|
|
ZDDC_DEPLOY_RELEASES_DIR="$DEPLOY_DIR" \
|
|
sh "$WT/${TOOL}/build.sh" --release "$CHANNEL"
|
|
|
|
DST="$DEPLOY_DIR/${TOOL}_${CHANNEL}.html"
|
|
if [ ! -f "$DST" ]; then
|
|
echo "error: build did not produce $DST" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "Wrote $DST"
|
|
echo "Done. ${CHANNEL} channel for ${TOOL} now reflects ${LATEST_TAG}."
|
|
echo "Run ./deploy --releases to push it to the live site."
|