progmaweb
The site and account service of Progmasoft: a Next.js frontend and an ASP.NET Core API.
Clonegit clone https://git.progmasoft.com/progmaweb
List C, C++ and Objective-C packages on ViGet instead of Tala
- Commit
a69b53d92b18a0ecd0d8710efbddd4799dc6a3e7- Author
- Leitwolf11 ·
- Parents
80d46cbffc87
Changes
apps/web/app/sitemap.ts | 8 +- .../app/viget/langs/{tala => [language]}/page.tsx | 52 +++++-- apps/web/app/viget/page.tsx | 7 +- apps/web/components/ViGetFooter.tsx | 6 +- apps/web/components/ViGetHeader.tsx | 2 +- apps/web/lib/localization.ts | 65 ++++---- apps/web/lib/viget-catalogs.ts | 172 ++++++++++++++++----- apps/web/proxy.ts | 14 +- apps/web/tests/viget-catalogs.test.mjs | 34 ++-- 9 files changed, 253 insertions(+), 107 deletions(-) diff --git a/apps/web/app/sitemap.ts b/apps/web/app/sitemap.ts index 714a2fa..511e18b 100644 --- a/apps/web/app/sitemap.ts +++ b/apps/web/app/sitemap.ts @@ -20,11 +20,11 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> { changeFrequency: "weekly", priority: 1, }, - { - url: "https://viget.progmasoft.com/langs/tala", - changeFrequency: "weekly", + ...["c", "cpp", "objc"].map((language) => ({ + url: `https://viget.progmasoft.com/langs/${language}`, + changeFrequency: "weekly" as const, priority: 0.8, - }, + })), { url: "https://viget.progmasoft.com/dslplugins/tazel", changeFrequency: "weekly", diff --git a/apps/web/app/viget/langs/tala/page.tsx b/apps/web/app/viget/langs/[language]/page.tsx similarity index 59% rename from apps/web/app/viget/langs/tala/page.tsx rename to apps/web/app/viget/langs/[language]/page.tsx index e5aeafb..7dcb022 100644 --- a/apps/web/app/viget/langs/tala/page.tsx +++ b/apps/web/app/viget/langs/[language]/page.tsx @@ -2,26 +2,49 @@ // SPDX-License-Identifier: AGPL-3.0-or-later WITH AdditionRef-Progmasoft-Patent-Grant-1.1 import type { Metadata } from "next"; +import { notFound } from "next/navigation"; import { ViGetFooter } from "@/components/ViGetFooter"; import { ViGetHeader } from "@/components/ViGetHeader"; import { getLocale } from "@/lib/locale.server"; -import { forwardArrow, getMessages } from "@/lib/localization"; -import { catalogText } from "@/lib/viget-catalogs"; +import { getMessages } from "@/lib/localization"; +import { + catalogText, + isLanguageSlug, + languageSlugs, +} from "@/lib/viget-catalogs"; -export async function generateMetadata(): Promise<Metadata> { - const catalogs = catalogText(await getLocale()); +type Parameters = { params: Promise<{ language: string }> }; + +// The languages are fixed; any other segment is no catalog. +export const dynamicParams = false; + +export function generateStaticParams() { + return languageSlugs.map((language) => ({ language })); +} + +export async function generateMetadata({ + params, +}: Parameters): Promise<Metadata> { + const { language } = await params; + if (!isLanguageSlug(language)) return { title: "ViGet" }; + const page = catalogText(await getLocale()).languages[language]; return { - title: `${catalogs.talaTitle} · ViGet`, - description: catalogs.talaDescription, - alternates: { canonical: "https://viget.progmasoft.com/langs/tala" }, + title: `${page.title} · ViGet`, + description: page.description, + alternates: { + canonical: `https://viget.progmasoft.com/langs/${language}`, + }, robots: { index: true, follow: true }, }; } -export default async function TalaPackagesPage() { +export default async function LanguagePackagesPage({ params }: Parameters) { + const { language } = await params; + if (!isLanguageSlug(language)) notFound(); const locale = await getLocale(); const { viget } = getMessages(locale); const catalogs = catalogText(locale); + const page = catalogs.languages[language]; return ( <div className="viget-surface"> <ViGetHeader locale={locale} /> @@ -30,8 +53,8 @@ export default async function TalaPackagesPage() { <div className="shell viget-plugin-grid"> <div className="viget-hero-copy"> <p className="eyebrow">ViGet · LANGUAGES</p> - <h1>{catalogs.talaTitle}</h1> - <p>{catalogs.talaDescription}</p> + <h1>{page.title}</h1> + <p>{page.description}</p> <div className="hero-actions"> <a className="button button-secondary" @@ -39,9 +62,6 @@ export default async function TalaPackagesPage() { > {catalogs.backToRegistry} </a> - <a className="viget-text-link" href="https://tala.run/"> - Tala {forwardArrow(locale)} - </a> </div> </div> <aside @@ -52,8 +72,8 @@ export default async function TalaPackagesPage() { <span aria-hidden="true" /> {viget.available} </div> - <h2 id="package-availability-title">{catalogs.talaEmptyTitle}</h2> - <p>{catalogs.talaEmptyDescription}</p> + <h2 id="package-availability-title">{page.emptyTitle}</h2> + <p>{catalogs.languageEmptyDescription}</p> <dl> <div> <dt>{viget.packageFormat}</dt> @@ -68,7 +88,7 @@ export default async function TalaPackagesPage() { <dd>{viget.publishingClosed}</dd> </div> </dl> - <code>/langs/tala/<Publisher>/<Name>/</code> + <code>/langs/{language}/<Publisher>/<Name>/</code> </aside> </div> </section> diff --git a/apps/web/app/viget/page.tsx b/apps/web/app/viget/page.tsx index 65c7f81..2934a74 100644 --- a/apps/web/app/viget/page.tsx +++ b/apps/web/app/viget/page.tsx @@ -47,8 +47,11 @@ export default async function ViGetPage() { > {viget.createAccount} </a> - <a className="button button-secondary" href="https://tala.run/"> - {viget.exploreTala} + <a + className="button button-secondary" + href="https://tazel.net/" + > + {viget.exploreTazel} </a> </div> </div> diff --git a/apps/web/components/ViGetFooter.tsx b/apps/web/components/ViGetFooter.tsx index d3d2858..90a87d6 100644 --- a/apps/web/components/ViGetFooter.tsx +++ b/apps/web/components/ViGetFooter.tsx @@ -15,11 +15,13 @@ export function ViGetFooter({ locale }: { locale: Locale }) { </div> <div> <strong>{viget.registry}</strong> - <a href="https://viget.progmasoft.com/langs/tala">{viget.packages}</a> + <a href="https://viget.progmasoft.com/#languages-title"> + {viget.packages} + </a> <a href="https://viget.progmasoft.com/dslplugins/tazel"> {viget.dslPlugins} </a> - <a href="https://tala.run/">Tala</a> + <a href="https://tazel.net/">Tazel</a> </div> <div> <strong>Progmasoft</strong> diff --git a/apps/web/components/ViGetHeader.tsx b/apps/web/components/ViGetHeader.tsx index 1e22793..da1ea52 100644 --- a/apps/web/components/ViGetHeader.tsx +++ b/apps/web/components/ViGetHeader.tsx @@ -16,7 +16,7 @@ export function ViGetHeader({ locale }: { locale: Locale }) { <span>ViGet</span> </div> <nav className="primary-nav" aria-label={viget.navigationLabel}> - <Link href="https://viget.progmasoft.com/langs/tala"> + <Link href="https://viget.progmasoft.com/#languages-title"> {viget.packages} </Link> <Link href="https://viget.progmasoft.com/dslplugins/tazel"> diff --git a/apps/web/lib/localization.ts b/apps/web/lib/localization.ts index a92906a..6913990 100644 --- a/apps/web/lib/localization.ts +++ b/apps/web/lib/localization.ts @@ -142,7 +142,7 @@ export const messages = { dashboardTitle: "Dashboard", vigetTitle: "ViGet Package Registry by Progmasoft", vigetDescription: - "The Tala package registry is online, but no packages have been published yet.", + "The package registry for C, C++ and Objective-C is online, but no packages have been published yet.", dslPluginsTitle: "DSL Plugins · ViGet Package Registry by Progmasoft", dslPluginsDescription: "The ViGet Kotlin DSL plugin catalog is online, but no plugins have been published yet.", @@ -310,11 +310,11 @@ export const messages = { login: "Log in", register: "Register", homeEyebrow: "ViGet package registry", - homeTitle: "Packages for the Tala ecosystem.", + homeTitle: "Packages for C, C++ and Objective-C.", homeDescription: - "ViGet is the canonical source for Tala packages and project DSL plugins, operated directly by Progmasoft.", + "ViGet is the canonical source for C, C++ and Objective-C packages and for the DSL plugins of build systems, operated directly by Progmasoft.", createAccount: "Create account", - exploreTala: "Explore Tala", + exploreTazel: "Explore Tazel", available: "Registry available", emptyTitle: "The public catalog is empty.", emptyDescription: @@ -327,10 +327,10 @@ export const messages = { catalogsTitle: "Two artifact types, one registry.", catalogsDescription: "Packages and project DSL plugins have separate, predictable coordinate spaces.", - talaPackages: "Tala packages", + languagePackages: "Packages", vipkgCatalog: "ViPkg catalog", vipkgDescription: - "Libraries and applications authored in Tala, distributed as .vipkg artifacts.", + "Libraries and applications in C, C++ and Objective-C, distributed as .vipkg artifacts.", projectExtensions: "Project extensions", kotlinPlugins: "Kotlin DSL plugins", kotlinDescription: @@ -355,7 +355,7 @@ export const messages = { pluginEyebrow: "ViGet · Kotlin DSL plugins", pluginTitle: "Extend the project model.", pluginDescription: - "Kotlin DSL plugins are JAR artifacts for the project file of Tazel. They are separate from Tala .vipkg packages.", + "Kotlin DSL plugins are JAR artifacts for the project file of Tazel. They are separate from .vipkg packages.", backToPackages: "Back to packages", followDevelopment: "Follow development", pluginAvailable: "Catalog available", @@ -380,7 +380,7 @@ export const messages = { ], ], footerDescription: - "ViGet is the package and Kotlin DSL plugin registry for the Tala ecosystem.", + "ViGet is the registry of packages for C, C++ and Objective-C and of Kotlin DSL plugins.", registry: "Registry", support: "Support", source: "Source", @@ -402,7 +402,7 @@ export const messages = { dashboardTitle: "Kontoübersicht", vigetTitle: "ViGet-Paketregistrierung von Progmasoft", vigetDescription: - "Die Tala-Paketregistrierung ist online, enthält aber noch keine veröffentlichten Pakete.", + "Die Paketregistrierung für C, C++ und Objective-C ist online, enthält aber noch keine veröffentlichten Pakete.", dslPluginsTitle: "DSL-Plugins · ViGet-Paketregistrierung von Progmasoft", dslPluginsDescription: "Der ViGet-Katalog für Kotlin-DSL-Plugins ist online, enthält aber noch keine veröffentlichten Plugins.", @@ -574,11 +574,11 @@ export const messages = { login: "Anmelden", register: "Registrieren", homeEyebrow: "ViGet-Paketregistrierung", - homeTitle: "Pakete für das Tala-Ökosystem.", + homeTitle: "Pakete für C, C++ und Objective-C.", homeDescription: - "ViGet ist die kanonische Quelle für Tala-Pakete und Projekt-DSL-Plugins und wird direkt von Progmasoft betrieben.", + "ViGet ist die kanonische Quelle für Pakete in C, C++ und Objective-C und für die DSL-Plugins von Build-Systemen und wird direkt von Progmasoft betrieben.", createAccount: "Konto erstellen", - exploreTala: "Tala entdecken", + exploreTazel: "Tazel entdecken", available: "Paketregistrierung verfügbar", emptyTitle: "Der öffentliche Katalog ist leer.", emptyDescription: @@ -591,10 +591,10 @@ export const messages = { catalogsTitle: "Zwei Artefakttypen, eine Paketregistrierung.", catalogsDescription: "Pakete und Projekt-DSL-Plugins besitzen getrennte, vorhersehbare Koordinatenräume.", - talaPackages: "Tala-Pakete", + languagePackages: "Pakete", vipkgCatalog: "ViPkg-Katalog", vipkgDescription: - "In Tala entwickelte Bibliotheken und Anwendungen, verteilt als .vipkg-Artefakte.", + "Bibliotheken und Anwendungen in C, C++ und Objective-C, verteilt als .vipkg-Artefakte.", projectExtensions: "Projekterweiterungen", kotlinPlugins: "Kotlin-DSL-Plugins", kotlinDescription: @@ -619,7 +619,7 @@ export const messages = { pluginEyebrow: "ViGet · Kotlin-DSL-Plugins", pluginTitle: "Das Projektmodell erweitern.", pluginDescription: - "Kotlin-DSL-Plugins sind JAR-Artefakte für die Projektdatei von Tazel. Sie sind von Tala-.vipkg-Paketen getrennt.", + "Kotlin-DSL-Plugins sind JAR-Artefakte für die Projektdatei von Tazel. Sie sind von .vipkg-Paketen getrennt.", backToPackages: "Zurück zu den Paketen", followDevelopment: "Entwicklung verfolgen", pluginAvailable: "Katalog verfügbar", @@ -644,7 +644,7 @@ export const messages = { ], ], footerDescription: - "ViGet ist die Paket- und Kotlin-DSL-Plugin-Registrierung für das Tala-Ökosystem.", + "ViGet ist die Registrierung für Pakete in C, C++ und Objective-C und für Kotlin-DSL-Plugins.", registry: "Paketregistrierung", support: "Support", source: "Quellcode", @@ -666,7 +666,7 @@ export const messages = { dashboardTitle: "Панель управления", vigetTitle: "Реестр пакетов ViGet от Progmasoft", vigetDescription: - "Реестр пакетов Tala работает, но опубликованных пакетов пока нет.", + "Реестр пакетов для C, C++ и Objective-C работает, но опубликованных пакетов пока нет.", dslPluginsTitle: "DSL-плагины · Реестр пакетов ViGet от Progmasoft", dslPluginsDescription: "Каталог Kotlin DSL-плагинов ViGet работает, но опубликованных плагинов пока нет.", @@ -838,11 +838,11 @@ export const messages = { login: "Войти", register: "Регистрация", homeEyebrow: "Реестр пакетов ViGet", - homeTitle: "Пакеты для экосистемы Tala.", + homeTitle: "Пакеты для C, C++ и Objective-C.", homeDescription: - "ViGet — канонический источник пакетов Tala и DSL-плагинов проектов, которым напрямую управляет Progmasoft.", + "ViGet — канонический источник пакетов для C, C++ и Objective-C и DSL-плагинов систем сборки, которым напрямую управляет Progmasoft.", createAccount: "Создать аккаунт", - exploreTala: "Подробнее о Tala", + exploreTazel: "Подробнее о Tazel", available: "Реестр доступен", emptyTitle: "Публичный каталог пуст.", emptyDescription: @@ -855,10 +855,10 @@ export const messages = { catalogsTitle: "Два вида артефактов, один реестр.", catalogsDescription: "У пакетов и DSL-плагинов проектов отдельные предсказуемые пространства координат.", - talaPackages: "Пакеты Tala", + languagePackages: "Пакеты", vipkgCatalog: "Каталог ViPkg", vipkgDescription: - "Библиотеки и приложения, написанные на Tala, распространяются как артефакты .vipkg.", + "Библиотеки и приложения на C, C++ и Objective-C распространяются как артефакты .vipkg.", projectExtensions: "Расширения проектов", kotlinPlugins: "Kotlin DSL-плагины", kotlinDescription: @@ -883,7 +883,7 @@ export const messages = { pluginEyebrow: "ViGet · Kotlin DSL-плагины", pluginTitle: "Расширяйте модель проекта.", pluginDescription: - "Kotlin DSL-плагины — это JAR-артефакты для файла проекта Tazel. Они отделены от пакетов Tala в формате .vipkg.", + "Kotlin DSL-плагины — это JAR-артефакты для файла проекта Tazel. Они отделены от пакетов в формате .vipkg.", backToPackages: "Назад к пакетам", followDevelopment: "Следить за разработкой", pluginAvailable: "Каталог доступен", @@ -908,7 +908,7 @@ export const messages = { ], ], footerDescription: - "ViGet — реестр пакетов и Kotlin DSL-плагинов экосистемы Tala.", + "ViGet — реестр пакетов для C, C++ и Objective-C и Kotlin DSL-плагинов.", registry: "Реестр", support: "Поддержка", source: "Исходный код", @@ -929,7 +929,7 @@ export const messages = { dashboardTitle: "לוח בקרה", vigetTitle: "מאגר החבילות ViGet מבית Progmasoft", vigetDescription: - "מאגר החבילות של Tala פעיל, אך עדיין לא פורסמו בו חבילות.", + "מאגר החבילות ל-C, ל-C++ ול-Objective-C פעיל, אך עדיין לא פורסמו בו חבילות.", dslPluginsTitle: "תוספי DSL · מאגר החבילות ViGet מבית Progmasoft", dslPluginsDescription: "קטלוג תוספי Kotlin DSL של ViGet פעיל, אך עדיין לא פורסמו בו תוספים.", @@ -1085,11 +1085,11 @@ export const messages = { login: "כניסה", register: "הרשמה", homeEyebrow: "מאגר החבילות ViGet", - homeTitle: "חבילות לאקוסיסטם של Tala.", + homeTitle: "חבילות ל-C, ל-C++ ול-Objective-C.", homeDescription: - "ViGet הוא המקור הרשמי לחבילות Tala ולתוספי DSL לפרויקטים, בהפעלה ישירה של Progmasoft.", + "ViGet הוא המקור הרשמי לחבילות C, C++ ו-Objective-C ולתוספי DSL של מערכות בנייה, בהפעלה ישירה של Progmasoft.", createAccount: "יצירת חשבון", - exploreTala: "להכיר את Tala", + exploreTazel: "להכיר את Tazel", available: "המאגר זמין", emptyTitle: "הקטלוג הציבורי ריק.", emptyDescription: @@ -1102,9 +1102,10 @@ export const messages = { catalogsTitle: "שני סוגי תוצרים, מאגר אחד.", catalogsDescription: "לחבילות ולתוספי DSL לפרויקטים יש מרחבי קואורדינטות נפרדים וצפויים.", - talaPackages: "חבילות Tala", + languagePackages: "חבילות", vipkgCatalog: "קטלוג ViPkg", - vipkgDescription: "ספריות ויישומים שנכתבו ב-Tala ומופצים כתוצרי .vipkg.", + vipkgDescription: + "ספריות ויישומים ב-C, ב-C++ וב-Objective-C, שמופצים כתוצרי .vipkg.", projectExtensions: "הרחבות לפרויקטים", kotlinPlugins: "תוספי Kotlin DSL", kotlinDescription: @@ -1126,7 +1127,7 @@ export const messages = { pluginEyebrow: "ViGet · תוספי Kotlin DSL", pluginTitle: "להרחיב את מודל הפרויקט.", pluginDescription: - "תוספי Kotlin DSL הם תוצרי JAR עבור קובץ הפרויקט של Tazel. הם נפרדים מחבילות .vipkg של Tala.", + "תוספי Kotlin DSL הם תוצרי JAR עבור קובץ הפרויקט של Tazel. הם נפרדים מחבילות .vipkg.", backToPackages: "חזרה לחבילות", followDevelopment: "למעקב אחר הפיתוח", pluginAvailable: "הקטלוג זמין", @@ -1150,7 +1151,7 @@ export const messages = { ], ], footerDescription: - "ViGet הוא מאגר החבילות ותוספי Kotlin DSL של האקוסיסטם של Tala.", + "ViGet הוא המאגר של חבילות ל-C, ל-C++ ול-Objective-C ושל תוספי Kotlin DSL.", registry: "מאגר", support: "תמיכה", source: "קוד מקור", diff --git a/apps/web/lib/viget-catalogs.ts b/apps/web/lib/viget-catalogs.ts index 410d3d1..15a10a0 100644 --- a/apps/web/lib/viget-catalogs.ts +++ b/apps/web/lib/viget-catalogs.ts @@ -12,11 +12,31 @@ export type Catalog = { readonly path?: string; }; +/** The languages ViGet hosts packages of, by the last segment of their path. */ +export const languageSlugs = ["c", "cpp", "objc"] as const; + +/** One language catalog, such as `c` for /langs/c. */ +export type LanguageSlug = (typeof languageSlugs)[number]; + +/** Whether [value] names a language catalog. */ +export function isLanguageSlug(value: string): value is LanguageSlug { + return (languageSlugs as readonly string[]).includes(value); +} + +/** The name of each language as the catalogs spell it; names are not translated. */ +export const languageNames: Record<LanguageSlug, string> = { + c: "C", + cpp: "C++", + objc: "Objective-C", +}; + /** The languages whose packages ViGet hosts, in the order the page lists them. */ -export const languageCatalogs: readonly Catalog[] = [ - { name: "Tala", path: "/langs/tala" }, - { name: "C++" }, -]; +export const languageCatalogs: readonly Catalog[] = languageSlugs.map( + (slug) => ({ + name: languageNames[slug], + path: `/langs/${slug}`, + }), +); /** The build systems whose DSL plugins ViGet hosts, in the order the page lists them. */ export const buildSystemCatalogs: readonly Catalog[] = [ @@ -29,6 +49,13 @@ export const buildSystemCatalogs: readonly Catalog[] = [ export const languagesHeading = "LANGUAGES"; export const buildSystemsHeading = "BUILD SYSTEM DSL PLUGINS"; +/** The words of the page of one language catalog. */ +type LanguageText = { + title: string; + description: string; + emptyTitle: string; +}; + type CatalogText = { statusEyebrow: string; languagesDescription: string; @@ -37,10 +64,8 @@ type CatalogText = { holds: Record<string, string>; notAvailable: string; open: string; - talaTitle: string; - talaDescription: string; - talaEmptyTitle: string; - talaEmptyDescription: string; + languages: Record<LanguageSlug, LanguageText>; + languageEmptyDescription: string; tazelTitle: string; tazelDescription: string; backToRegistry: string; @@ -54,21 +79,40 @@ const text: Record<Locale, CatalogText> = { buildSystemsDescription: "Plugins that extend the project file of a build system.", holds: { - Tala: "Libraries and applications written in Tala.", + C: "Libraries and applications written in C.", + "C++": "Libraries and applications written in C++.", + "Objective-C": + "Libraries and applications written in Objective-C and Objective-C++.", Tazel: "Kotlin JAR plugins for the project file of Tazel.", Gradle: "Gradle plugins of Progmasoft, from the Gradle Plugin Portal.", }, notAvailable: "Not available yet", open: "Open catalog", - talaTitle: "Tala packages", - talaDescription: - "Libraries and applications written in Tala, distributed as .vipkg artifacts and published under a Progmasoft Account.", - talaEmptyTitle: "No Tala packages yet.", - talaEmptyDescription: + languages: { + c: { + title: "C packages", + description: + "Libraries and applications written in C, distributed as .vipkg artifacts and published under a Progmasoft Account.", + emptyTitle: "No C packages yet.", + }, + cpp: { + title: "C++ packages", + description: + "Libraries and applications written in C++, distributed as .vipkg artifacts and published under a Progmasoft Account.", + emptyTitle: "No C++ packages yet.", + }, + objc: { + title: "Objective-C packages", + description: + "Libraries and applications written in Objective-C and Objective-C++, distributed as .vipkg artifacts and published under a Progmasoft Account.", + emptyTitle: "No Objective-C packages yet.", + }, + }, + languageEmptyDescription: "The catalog is ready and intentionally contains no placeholder packages. Publishing opens with the ViGet client of Tazel.", tazelTitle: "Tazel DSL plugins", tazelDescription: - "Kotlin JAR plugins that extend the project file of Tazel, the build system of Tala. They are separate from .vipkg packages.", + "Kotlin JAR plugins that extend the project file of Tazel, the build system for C, C++, Objective-C, Objective-C++ and Zig. They are separate from .vipkg packages.", backToRegistry: "Back to ViGet", }, "de-DE": { @@ -78,21 +122,40 @@ const text: Record<Locale, CatalogText> = { buildSystemsDescription: "Plugins, die die Projektdatei eines Build-Systems erweitern.", holds: { - Tala: "Bibliotheken und Anwendungen, geschrieben in Tala.", + C: "Bibliotheken und Anwendungen, geschrieben in C.", + "C++": "Bibliotheken und Anwendungen, geschrieben in C++.", + "Objective-C": + "Bibliotheken und Anwendungen, geschrieben in Objective-C und Objective-C++.", Tazel: "Kotlin-JAR-Plugins für die Projektdatei von Tazel.", Gradle: "Gradle-Plugins von Progmasoft, vom Gradle Plugin Portal.", }, notAvailable: "Noch nicht verfügbar", open: "Katalog öffnen", - talaTitle: "Tala-Pakete", - talaDescription: - "Bibliotheken und Anwendungen in Tala, verteilt als .vipkg-Artefakte und veröffentlicht unter einem Progmasoft-Konto.", - talaEmptyTitle: "Noch keine Tala-Pakete.", - talaEmptyDescription: + languages: { + c: { + title: "C-Pakete", + description: + "Bibliotheken und Anwendungen in C, verteilt als .vipkg-Artefakte und veröffentlicht unter einem Progmasoft-Konto.", + emptyTitle: "Noch keine C-Pakete.", + }, + cpp: { + title: "C++-Pakete", + description: + "Bibliotheken und Anwendungen in C++, verteilt als .vipkg-Artefakte und veröffentlicht unter einem Progmasoft-Konto.", + emptyTitle: "Noch keine C++-Pakete.", + }, + objc: { + title: "Objective-C-Pakete", + description: + "Bibliotheken und Anwendungen in Objective-C und Objective-C++, verteilt als .vipkg-Artefakte und veröffentlicht unter einem Progmasoft-Konto.", + emptyTitle: "Noch keine Objective-C-Pakete.", + }, + }, + languageEmptyDescription: "Der Katalog ist bereit und enthält bewusst keine Platzhalterpakete. Die Veröffentlichung öffnet mit dem ViGet-Client von Tazel.", tazelTitle: "Tazel-DSL-Plugins", tazelDescription: - "Kotlin-JAR-Plugins, die die Projektdatei von Tazel, dem Build-System von Tala, erweitern. Sie sind von .vipkg-Paketen getrennt.", + "Kotlin-JAR-Plugins, die die Projektdatei von Tazel erweitern, dem Build-System für C, C++, Objective-C, Objective-C++ und Zig. Sie sind von .vipkg-Paketen getrennt.", backToRegistry: "Zurück zu ViGet", }, "ru-RU": { @@ -102,21 +165,40 @@ const text: Record<Locale, CatalogText> = { buildSystemsDescription: "Плагины, расширяющие файл проекта системы сборки.", holds: { - Tala: "Библиотеки и приложения, написанные на Tala.", + C: "Библиотеки и приложения, написанные на C.", + "C++": "Библиотеки и приложения, написанные на C++.", + "Objective-C": + "Библиотеки и приложения, написанные на Objective-C и Objective-C++.", Tazel: "Плагины Kotlin JAR для файла проекта Tazel.", Gradle: "Плагины Gradle от Progmasoft, с Gradle Plugin Portal.", }, notAvailable: "Пока недоступно", open: "Открыть каталог", - talaTitle: "Пакеты Tala", - talaDescription: - "Библиотеки и приложения на Tala, распространяемые как артефакты .vipkg и публикуемые от имени учётной записи Progmasoft.", - talaEmptyTitle: "Пакетов Tala пока нет.", - talaEmptyDescription: + languages: { + c: { + title: "Пакеты C", + description: + "Библиотеки и приложения на C, распространяемые как артефакты .vipkg и публикуемые от имени учётной записи Progmasoft.", + emptyTitle: "Пакетов C пока нет.", + }, + cpp: { + title: "Пакеты C++", + description: + "Библиотеки и приложения на C++, распространяемые как артефакты .vipkg и публикуемые от имени учётной записи Progmasoft.", + emptyTitle: "Пакетов C++ пока нет.", + }, + objc: { + title: "Пакеты Objective-C", + description: + "Библиотеки и приложения на Objective-C и Objective-C++, распространяемые как артефакты .vipkg и публикуемые от имени учётной записи Progmasoft.", + emptyTitle: "Пакетов Objective-C пока нет.", + }, + }, + languageEmptyDescription: "Каталог готов и намеренно не содержит пакетов-заглушек. Публикация откроется вместе с клиентом ViGet в Tazel.", tazelTitle: "DSL-плагины Tazel", tazelDescription: - "Плагины Kotlin JAR, расширяющие файл проекта Tazel, системы сборки Tala. Они отделены от пакетов .vipkg.", + "Плагины Kotlin JAR, расширяющие файл проекта Tazel — системы сборки для C, C++, Objective-C, Objective-C++ и Zig. Они отделены от пакетов .vipkg.", backToRegistry: "Назад к ViGet", }, "he-IL": { @@ -124,21 +206,39 @@ const text: Record<Locale, CatalogText> = { languagesDescription: "חבילות שנכתבו בשפה, כתוצרי .vipkg.", buildSystemsDescription: "תוספים שמרחיבים את קובץ הפרויקט של מערכת בנייה.", holds: { - Tala: "ספריות ויישומים שנכתבו ב-Tala.", + C: "ספריות ויישומים שנכתבו ב-C.", + "C++": "ספריות ויישומים שנכתבו ב-C++.", + "Objective-C": "ספריות ויישומים שנכתבו ב-Objective-C וב-Objective-C++.", Tazel: "תוספי Kotlin JAR עבור קובץ הפרויקט של Tazel.", Gradle: "תוספי Gradle של Progmasoft, מ-Gradle Plugin Portal.", }, notAvailable: "עוד לא זמין", open: "פתיחת הקטלוג", - talaTitle: "חבילות Tala", - talaDescription: - "ספריות ויישומים ב-Tala, שמופצים כתוצרי .vipkg ומתפרסמים תחת חשבון Progmasoft.", - talaEmptyTitle: "עוד אין חבילות Tala.", - talaEmptyDescription: + languages: { + c: { + title: "חבילות C", + description: + "ספריות ויישומים ב-C, שמופצים כתוצרי .vipkg ומתפרסמים תחת חשבון Progmasoft.", + emptyTitle: "עוד אין חבילות C.", + }, + cpp: { + title: "חבילות C++", + description: + "ספריות ויישומים ב-C++, שמופצים כתוצרי .vipkg ומתפרסמים תחת חשבון Progmasoft.", + emptyTitle: "עוד אין חבילות C++.", + }, + objc: { + title: "חבילות Objective-C", + description: + "ספריות ויישומים ב-Objective-C וב-Objective-C++, שמופצים כתוצרי .vipkg ומתפרסמים תחת חשבון Progmasoft.", + emptyTitle: "עוד אין חבילות Objective-C.", + }, + }, + languageEmptyDescription: "הקטלוג מוכן, ובכוונה אין בו חבילות ממלאות מקום. הפרסום ייפתח יחד עם לקוח ה-ViGet של Tazel.", tazelTitle: "תוספי DSL של Tazel", tazelDescription: - "תוספי Kotlin JAR שמרחיבים את קובץ הפרויקט של Tazel, מערכת הבנייה של Tala. הם נפרדים מחבילות .vipkg.", + "תוספי Kotlin JAR שמרחיבים את קובץ הפרויקט של Tazel, מערכת הבנייה ל-C, ל-C++, ל-Objective-C, ל-Objective-C++ ול-Zig. הם נפרדים מחבילות .vipkg.", backToRegistry: "חזרה ל-ViGet", }, }; diff --git a/apps/web/proxy.ts b/apps/web/proxy.ts index 17a34da..f82e370 100644 --- a/apps/web/proxy.ts +++ b/apps/web/proxy.ts @@ -166,10 +166,13 @@ function route(request: NextRequest, headers: Headers): NextResponse { return rewrite(headers, internalRoute(request, "/viget")); } // Packages are grouped by the language they are written in and DSL - // plugins by the build system they extend. A group without a catalog of - // its own leads to the one catalog there is. - if (pathname === "/langs/tala" || pathname === "/langs/tala/") { - return rewrite(headers, internalRoute(request, "/viget/langs/tala")); + // plugins by the build system they extend. + const language = /^\/langs\/(c|cpp|objc)\/?$/.exec(pathname); + if (language) { + return rewrite( + headers, + internalRoute(request, `/viget/langs/${language[1]}`), + ); } if (pathname === "/dslplugins/tazel" || pathname === "/dslplugins/tazel/") { return rewrite( @@ -201,9 +204,10 @@ function route(request: NextRequest, headers: Headers): NextResponse { internalRoute(request, "/viget/dslplugins/gradle"), ); } + // The languages are listed on the home page of ViGet. if (pathname === "/langs" || pathname === "/langs/") { return NextResponse.redirect( - new URL("https://viget.progmasoft.com/langs/tala"), + new URL("https://viget.progmasoft.com/#languages-title"), 308, ); } diff --git a/apps/web/tests/viget-catalogs.test.mjs b/apps/web/tests/viget-catalogs.test.mjs index ed1ea6d..6b487f4 100644 --- a/apps/web/tests/viget-catalogs.test.mjs +++ b/apps/web/tests/viget-catalogs.test.mjs @@ -9,17 +9,19 @@ import { buildSystemsHeading, catalogText, languageCatalogs, + languageSlugs, languagesHeading, } from "../lib/viget-catalogs.ts"; const locales = ["en-US", "de-DE", "ru-RU", "he-IL"]; -test("the registry lists Tala and C++, then Tazel and Gradle, under their own headings", () => { +test("the registry lists C, C++ and Objective-C, then Tazel and Gradle, under their own headings", () => { assert.equal(languagesHeading, "LANGUAGES"); assert.equal(buildSystemsHeading, "BUILD SYSTEM DSL PLUGINS"); assert.deepEqual(languageCatalogs, [ - { name: "Tala", path: "/langs/tala" }, - { name: "C++" }, + { name: "C", path: "/langs/c" }, + { name: "C++", path: "/langs/cpp" }, + { name: "Objective-C", path: "/langs/objc" }, ]); assert.deepEqual(buildSystemCatalogs, [ { name: "Tazel", path: "/dslplugins/tazel" }, @@ -42,10 +44,19 @@ test("every open catalog says what it holds in every language", () => { assert.ok(value.trim().length > 0, `${locale} ${key}`); } } - assert.notEqual( - catalogText("de-DE").talaTitle, - catalogText("en-US").talaTitle, - ); + for (const slug of languageSlugs) { + for (const locale of locales) { + const page = catalogText(locale).languages[slug]; + for (const value of Object.values(page)) + assert.ok(value.trim().length > 0, `${locale} ${slug}`); + } + assert.notEqual( + catalogText("de-DE").languages[slug].title, + catalogText("en-US").languages[slug].title, + ); + } + // Tala is no longer developed; no catalog text names it. + assert.doesNotMatch(JSON.stringify(locales.map(catalogText)), /Tala\b/); }); test("a catalog that is not offered yet is a disabled button and links nowhere", () => { @@ -67,11 +78,16 @@ test("a catalog that is not offered yet is a disabled button and links nowhere", test("the ViGet host serves both catalogs and leads the bare groups to them", () => { const proxy = readFileSync(new URL("../proxy.ts", import.meta.url), "utf8"); - assert.match(proxy, /internalRoute\(request, "\/viget\/langs\/tala"\)/); + assert.match(proxy, /\^\\\/langs\\\/\(c\|cpp\|objc\)\\\/\?\$/); + assert.match( + proxy, + /internalRoute\(request, `\/viget\/langs\/\$\{language\[1\]\}`\)/, + ); + assert.doesNotMatch(proxy, /langs\/tala/); assert.match(proxy, /internalRoute\(request, "\/viget\/dslplugins\/tazel"\)/); assert.match( proxy, - /"https:\/\/viget\.progmasoft\.com\/langs\/tala"\),\s*308/, + /"https:\/\/viget\.progmasoft\.com\/#languages-title"\),\s*308/, ); assert.match( proxy,