Files
matrix-authentication-service/misc/update.sh
T
Quentin Gliech 67fdeecf70 config: add a generator for the configuration file reference
Adds a second bin target to mas-config which renders
docs/reference/configuration.md from the config JSON schema: doc
comments become the YAML comments, schemars examples/defaults become the
example values, and an x-doc schema extension (commented/skip/yaml)
covers the idioms that need hand-authoring. Wired into misc/update.sh so
the existing CI freshness check keeps the reference in sync.
2026-07-02 13:58:13 +02:00

29 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
# Copyright 2026 Element Creations Ltd.
# Copyright 2025 New Vector Ltd.
#
# SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
# Please see LICENSE files in the repository root for full details.
#
set -eu
export SQLX_OFFLINE=1
BASE_DIR="$(dirname "$0")/.."
CONFIG_SCHEMA="${BASE_DIR}/docs/config.schema.json"
CONFIG_REFERENCE="${BASE_DIR}/docs/reference/configuration.md"
API_SCHEMA="${BASE_DIR}/docs/api/spec.json"
GRAPHQL_SCHEMA="${BASE_DIR}/frontend/schema.graphql"
POLICIES_SCHEMA="${BASE_DIR}/policies/schema/"
set -x
cargo run -p mas-config > "${CONFIG_SCHEMA}"
cargo run -p mas-config --bin docs > "${CONFIG_REFERENCE}"
cargo run -p mas-handlers --bin graphql-schema > "${GRAPHQL_SCHEMA}"
cargo run -p mas-handlers --bin api-schema > "${API_SCHEMA}"
cargo run -p mas-i18n-scan -- --update "${BASE_DIR}/templates/" "${BASE_DIR}/translations/en.json"
OUT_DIR="${POLICIES_SCHEMA}" cargo run -p mas-policy
cd "${BASE_DIR}"
pnpm --filter mas-frontend run format
pnpm --filter mas-frontend run generate