Runway 1.0.1

This commit is contained in:
Runway committed 2026-10-21 13:49:47 -06:00
1 parent dcf819146b
commit ce217fc952
259 files changed
+22226 -206

No files matched your search

+14
View File
@@ -2,6 +2,20 @@
All notable changes are recorded here. Versions follow [Semantic Versioning](https://semver.org/).
## [2.3.1] — 2026-10-21
### Added
- **French for visitors.** `messages_fr.properties` carries the strings visitors see — the search box (placeholder
and button), the results heading, the result count, "no results" and the rate-limit notice — so a French page
shows them in French instead of falling back to English. The console's strings stay in English and Spanish, the
languages the console offers. A site's own `messages_fr.properties` still overrides any of them.
### Upgrade
Replace the plugin folder with this release's zip and restart. No setting or stored file changes; search-lucene
3.3.0 works with it unchanged.
## [2.3.0] — 2026-10-21
First public release of `search`: on-site search with a search-box widget that renders results on an editable
+1 -1
View File
@@ -37,7 +37,7 @@ export JAVA_HOME=/path/to/jdk-25
mvn -q verify
# → target/runway-plugin-search.jar
# target/search/ (cp -r into <external>/plugins/ and restart)
# target/runway-plugin-search-2.3.0.zip (upload at /__app/plugins → install)
# target/runway-plugin-search-2.3.1.zip (upload at /__app/plugins → install)
HOST_JAR=/path/to/runway/runway-app/target/runway-app-<version>-exec.jar \
JAVA_HOME=/path/to/jdk-25 scripts/verify-against-host.sh # boots the PACKAGED host and proves the contract live
```
@@ -0,0 +1,9 @@
# Runway Search plugin — French strings for what visitors see (the search box and the results). The console's
# strings stay in English and Spanish, the languages the console offers.
search.box.placeholder=Rechercher…
search.box.submit=Rechercher
search.results.heading=Recherche
search.results.none=Aucun résultat pour
search.results.count=résultat(s) pour
search.rate.limited=Trop de recherches — veuillez réessayer dans un instant.
+1 -1
View File
@@ -14,7 +14,7 @@
# =============================================================================
id: search
name: Search
version: 2.3.0
version: 2.3.1
# The @Configuration registered into the host context before refresh. Its package (mx.quest.search) lives
# OUTSIDE mx.quest.runway so the host never double-scans it. Beans are wired EXPLICITLY (no @ComponentScan).
+2 -2
View File
@@ -20,7 +20,7 @@
<groupId>mx.quest</groupId>
<artifactId>runway-plugin-search</artifactId>
<version>2.3.0</version>
<version>2.3.1</version>
<packaging>jar</packaging>
<name>Runway Search Plugin</name>
<licenses>
@@ -45,7 +45,7 @@
<!-- Reproducible builds: pins every archive entry's timestamp so two builds of the same source
produce byte-identical artifacts. Without it a jar embeds the build time, so a rebuild can
never match what was published. Bump at each release. -->
<project.build.outputTimestamp>2026-10-21T17:23:00Z</project.build.outputTimestamp>
<project.build.outputTimestamp>2026-10-21T19:31:00Z</project.build.outputTimestamp>
<!-- The runway-spi (and runway-spi-testkit) version this plugin compiles and tests against, from ~/.m2. -->
<runway.version>1.0.0</runway.version>
</properties>
+20 -8
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Build this plugin, drop it into a throwaway Runway deployment, boot the PACKAGED host in ACTIVE mode, and prove
# the search 2.1.1 contract end to end (SPI 0.6.0):
# this release's contract end to end:
# - it loads with ZERO host-linkage and bean-name/surface warnings, and its app-level settings bind;
# - the JSON API serves results anonymously; there is no plugin-owned /search page until one is installed;
# - the three operator actions are CSRF-protected POSTs: a GET (a cross-site link or <img>) changes nothing even
@@ -43,7 +43,7 @@ MVN="${MVN:-mvn}"
# Default host: the kernel at the root of the repository this plugin sits in (plugins/<name>/), else a kernel
# checkout named `runway` beside the plugins checkout.
if [ -z "${HOST_TARGET:-}" ]; then
if [ -f "$HERE/../../../runway-app/pom.xml" ]; then HOST_TARGET="$HERE/../../../runway-app/target"
if [ -f "$HERE/../../runway-app/pom.xml" ]; then HOST_TARGET="$HERE/../../runway-app/target"
else HOST_TARGET="$HERE/../../runway/runway-app/target"; fi
fi
@@ -114,9 +114,10 @@ make_site enforced enforced
make_site reviewed reviewed
sed -i 's/^ - "default"$/ - "default"\n - "enforced"\n - "reviewed"/' "$EXT/site-users.yml"
# A bilingual page whose visible copy comes ONLY from the site's bundles (decoupled th:text): the template holds an
# empty element. Kernel 1.0.0-rc6+ indexes the page as rendered in each language; search 2.2.0+ searches each
# language's own documents (on 2.1.1 + rc5, "facultad" found nothing).
# empty element. The kernel indexes the page as rendered in each language, and search searches each language's
# own documents. French is a site language too, for the visitor strings the plugin ships in French.
sed -i '/^locales:/a - "es"' "$SITES/default/site.yml"
sed -i '/^locales:/a - "fr"' "$SITES/default/site.yml"
T="$SITES/default/templates"
cat > "$T/faculty.html" <<'HTML'
<!DOCTYPE html><html><head><title>Faculty</title></head>
@@ -129,6 +130,13 @@ cat > "$T/faculty.th.xml" <<'XML'
</thlogic>
XML
printf 'path: /faculty\nlocalizedPaths:\n es: /facultad\nlocales: [en, es]\ntitle:\n en: Faculty\n es: Profesores\n' > "$T/faculty.meta.yml"
# A page carrying the search box in French as well (a French site's results page), to prove the plugin's French
# visitor strings are used there rather than English.
cat > "$T/recherche.html" <<'HTML'
<!DOCTYPE html><html><head><title>Recherche</title></head>
<body><main id="content"><div id="fr-search" data-widget="search/box"></div></main></body></html>
HTML
printf 'path: /find\nlocalizedPaths:\n fr: /recherche\nlocales: [en, fr]\ntitle:\n en: Find\n fr: Recherche\n' > "$T/recherche.meta.yml"
mkdir -p "$SITES/default/i18n"
printf '\nverify.faculty=Our students learn from a faculty of researchers.\n' >> "$SITES/default/i18n/messages.properties"
printf '\nverify.faculty=Nuestros alumnos aprenden con una facultad de excelencia.\n' >> "$SITES/default/i18n/messages_es.properties"
@@ -179,8 +187,8 @@ fi
curl -s -D "$SCRATCH/home.headers" "$BASE/" > "$SCRATCH/home.html"
ck "every page carries the loader script, stamped with the nonce the kernel's CSP allows" \
"n=\$(grep -oE '<script [^>]*src=\"/__plugin/search/static/highlight-loader.js[?]v=[0-9.]+\"[^>]*>' '$SCRATCH/home.html' | grep -oE 'nonce=\"[^\"]+\"' | sed -E 's/nonce=\"(.*)\"/\\1/'); [ -n \"\$n\" ] && grep -i '^content-security-policy' '$SCRATCH/home.headers' | grep -q \"nonce-\$n\""
ck "plugin files are cacheable with a content ETag (kernel 1.0.0-rc5+; rc4 and earlier send no-store)" \
"curl -s -D - -o /dev/null '$BASE/__plugin/search/static/highlight-loader.js?v=$PLUGIN_VERSION' | grep -qiE '^etag: ' || [ \"\${HOST_BEFORE_RC5:-0}\" = 1 ]"
ck "plugin files are cacheable with a content ETag" \
"curl -s -D - -o /dev/null '$BASE/__plugin/search/static/highlight-loader.js?v=$PLUGIN_VERSION' | grep -qiE '^etag: '"
ck "highlight-loader.js served as JavaScript" \
"curl -s -D - -o /dev/null '$BASE/__plugin/search/static/highlight-loader.js' | grep -qiE '^content-type: (text|application)/javascript'"
@@ -195,7 +203,7 @@ ck "…each result with its matched words and a link carrying them (2.1.0)" \
ck "the JSON API answers JSON" \
"curl -s -D - -o /dev/null '$BASE/search/api?q=about' | grep -qi '^content-type: application/json'"
echo "== every language searches its own text, bundle strings included (kernel 1.0.0-rc6+, search 2.2.0+) =="
echo "== every language searches its own text, bundle strings included =="
ck "the default site speaks Spanish too (fixture)" "grep -q '^- \"es\"' '$SITES/default/site.yml'"
ck "the page's copy is rendered from the bundle (fixture)" \
"curl -s '$BASE/es/facultad' | grep -q 'facultad de excelencia'"
@@ -270,6 +278,10 @@ ck "…the installed page renders the box and the results inline" \
"grep -q 'class=\"rw-search-box\"' '$SCRATCH/search-page.html' && grep -q 'href=\"/about#rw-hl=about\"' '$SCRATCH/search-page.html'"
ck "…and is noindex (a search-results page is the canonical index opt-out)" \
"grep -qi 'noindex' '$SCRATCH/search-page.html' '$SCRATCH/search-page.headers'"
curl -s -L -D "$SCRATCH/search-page-fr.headers" "$BASE/fr/recherche?q=zqxjvk" > "$SCRATCH/search-page-fr.html"
grep -q 'placeholder="Rechercher…"' "$SCRATCH/search-page-fr.html" || { echo " [debug] French response:"; grep -iE "^(HTTP|location)" "$SCRATCH/search-page-fr.headers" | sed "s/^/ /"; grep -o -E "(placeholder=\"[^\"]*\"|<html[^>]*>)" "$SCRATCH/search-page-fr.html" | head -3 | sed "s/^/ /"; }
ck "…a French visitor sees the plugin's French strings (no English fallback)" \
"grep -q 'placeholder=\"Rechercher…\"' '$SCRATCH/search-page-fr.html' && ! grep -q 'placeholder=\"Search…\"' '$SCRATCH/search-page-fr.html'"
ck "…and is never among its own results, though its title matches the query (2.1.1)" \
"grep -qiE '<title[^>]*>[^<]*search' '$SCRATCH/search-page.html' && ! curl -s '$BASE/search/api?q=search' | grep -q '\"url\":\"/search\"'"
install default > "$SCRATCH/install-again.txt"
@@ -337,7 +349,7 @@ ck "clear with the page's token redirects back to the settings (303)" \
"[ \"\$(sc default -o /dev/null -w '%{http_code}' -X POST '$BASE/search/no-results/clear' --data-urlencode \"_csrf=\$(token < '$SCRATCH/settings-2.html')\")\" = 303 ]"
ck "the list and the file are gone" "! sc default '$SETTINGS' | grep -q 'zebra crossing xyzzy' && [ ! -e '$NR_FILE' ]"
echo "== a Messages save reaches the index at once (kernel 1.0.0-rc6+: no reindex) =="
echo "== a Messages save reaches the index at once (no reindex) =="
login default
MSG_TOKEN="$(sc default "$BASE/__admin/messages" | token)"
ck "the Messages save is accepted" \
@@ -50,7 +50,7 @@ public class SearchConfig {
* plugin-file cache lifetime. {@code SearchConfigTest} holds it equal to {@code plugin.yml}'s version and to the
* URLs inside the static scripts.
*/
public static final String VERSION = "2.3.0";
public static final String VERSION = "2.3.1";
/** The query a plugin file URL ends with. */
static final String ASSET_QUERY = "?v=" + VERSION;
@@ -181,10 +181,10 @@ class SearchConfigTest {
.matcher(pom);
assertTrue(version.find());
assertEquals(version.group(1), String.valueOf(yml.get("version")), "plugin.yml and pom.xml agree on the version");
assertEquals("2.3.0", version.group(1));
assertEquals("2.3.1", version.group(1));
assertEquals(version.group(1), SearchConfig.VERSION, "the ?v= on the plugin's file URLs is this release");
assertFalse(pom.contains("<artifactId>runway-app</artifactId>"), "no runway-app dependency in any scope");
assertTrue(pom.contains("<project.build.outputTimestamp>2026-10-21T17:23:00Z</project.build.outputTimestamp>"));
assertTrue(pom.contains("<project.build.outputTimestamp>2026-10-21T19:31:00Z</project.build.outputTimestamp>"));
}
@Test
+1 -1
View File
@@ -1,2 +1,2 @@
/* Runway Search plugin: added to every page of a site with search highlighting on. Loads highlight.js only when the address carries the #rw-hl= marker of a search result link, now or after a hashchange. Kept tiny on purpose: it is fetched with every page. */
(function(){function l(){if(window.__rwHl||location.hash.indexOf('rw-hl=')<0)return;window.__rwHl=1;var s=document.createElement('script');s.src='/__plugin/search/static/highlight.js?v=2.3.0';document.head.appendChild(s)}l();addEventListener('hashchange',l)})();
(function(){function l(){if(window.__rwHl||location.hash.indexOf('rw-hl=')<0)return;window.__rwHl=1;var s=document.createElement('script');s.src='/__plugin/search/static/highlight.js?v=2.3.1';document.head.appendChild(s)}l();addEventListener('hashchange',l)})();
+1 -1
View File
@@ -150,7 +150,7 @@
var link = document.createElement('link');
link.id = 'rw-search-highlight-css';
link.rel = 'stylesheet';
link.href = '/__plugin/search/static/highlight.css?v=2.3.0';
link.href = '/__plugin/search/static/highlight.css?v=2.3.1';
// First in <head>, so any ::highlight(rw-search) rule of the site comes later and wins.
document.head.insertBefore(link, document.head.firstChild);
}